-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from WPChill/3.0.0
3.0.0
- Loading branch information
Showing
71 changed files
with
1,900 additions
and
1,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "includes/submodules/banner"] | ||
path = includes/submodules/banner | ||
url = https://github.com/WPChill/wpchill-welcome-banner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?php | ||
/** | ||
* Challenge main class | ||
* | ||
* @since 2.6.8 | ||
* | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
|
||
class ST_Challenge_Modal{ | ||
|
||
|
||
public function __construct(){ | ||
|
||
if( is_admin() && $this->show_challenge() && 1 == get_option( 'wpmtst-challenge', 1 ) ){ | ||
add_action( 'admin_footer', array( $this, 'challenge_render' ), 99 ); | ||
add_action( 'admin_enqueue_scripts', array( $this, 'challenge_scripts' ) ); | ||
add_action( 'wp_ajax_wpmtst_challenge_hide', array( $this, 'wpmtst_challenge_hide' ) ); | ||
} | ||
|
||
} | ||
|
||
public function challenge_render(){ | ||
|
||
$new_gallery_url = add_query_arg( | ||
array( | ||
'post_type' => 'wpm-testimonial', | ||
), | ||
admin_url( 'post-new.php' ) | ||
); | ||
|
||
?> | ||
<div class="wpmtst-challenge-wrap"> | ||
<div class="wpmtst-challenge-header"> | ||
<span id="wpmtst-challenge-close" class="dashicons dashicons-no-alt"></span> | ||
<p><?php echo wp_kses_post( __( 'Start enjoying <strong>Strong Testimonials</strong> by adding your first testimonial.', 'strong-testimonials' ) ); ?></p> | ||
</div> | ||
<div class="wpmtst-challenge-list"> | ||
<p><span class="wpmtst-challenge-marker"></span> <?php esc_html_e( 'Primul lucru din lista', 'strong-testimonials' ); ?></p> | ||
<p><span class="wpmtst-challenge-marker"></span> <?php esc_html_e( 'Al 2-lea lucru din lista', 'strong-testimonials' ); ?></p> | ||
<p><span class="wpmtst-challenge-marker"></span> <?php esc_html_e( 'Al 3-lea lucru din lista', 'strong-testimonials' ); ?></p> | ||
<p><span class="wpmtst-challenge-marker"></span> <?php esc_html_e( 'Al 4-lea lucru din lista', 'strong-testimonials' ); ?></p> | ||
<p><span class="wpmtst-challenge-marker"></span> <?php esc_html_e( 'Al 5-lea lucru din lista', 'strong-testimonials' ); ?></p> | ||
</div> | ||
<div class="wpmtst-challenge-footer"> | ||
<img src="<?php echo esc_url( WPMTST_URL . 'admin/img/mascot.png' ); ?>" class="wpmtst-challenge-logo"/> | ||
<div> | ||
<h3>Strong Testimonials</h3> | ||
<p><span class="wpmtst-challenge-time">5:00</span> remaining.</p> | ||
</div> | ||
</div> | ||
<div class="wpmtst-challenge-footer-button"> | ||
<a id="wpmtst-challenge-button" href="<?php echo esc_url( $new_gallery_url ); ?>" class="wpmtst-btn wpmtst-challenge-btn"><?php esc_html_e( 'Create First Gallery', 'strong-testimonials' ); ?></a> | ||
</div> | ||
|
||
</div> | ||
<?php | ||
} | ||
|
||
public function challenge_scripts( $hook ) { | ||
|
||
wp_enqueue_style( 'wpmtst-challenge-style', WPMTST_URL . 'assets/css/challenge.css', array(), true ); | ||
wp_enqueue_script( 'wpmtst-challenge-script', WPMTST_URL . 'assets/js/challenge.js', array( 'jquery' ), '1.0.0', true ); | ||
$args = array( | ||
'ajaxurl' => admin_url( 'admin-ajax.php' ), | ||
'nonce' => wp_create_nonce( 'wpmtst-challenge' ), | ||
); | ||
wp_localize_script( 'wpmtst-challenge-script', 'wpmtstChallenge', $args ); | ||
|
||
} | ||
|
||
public function show_challenge(){ | ||
$args = array( | ||
'numberposts' => 1, | ||
'post_status' => 'any, trash', | ||
'post_type' => 'wpm-testimonial' | ||
); | ||
|
||
if( !isset( $_GET['post_type'] ) || 'wpm-testimonial' !== $_GET['post_type'] ){ | ||
return false; | ||
} | ||
|
||
if( empty( get_posts( $args ) ) ){ | ||
return true; | ||
} | ||
|
||
return false; | ||
|
||
} | ||
public function wpmtst_challenge_hide(){ | ||
|
||
$nonce = ''; | ||
|
||
if( isset( $_POST['nonce'] ) ){ | ||
|
||
$nonce = $_POST['nonce']; | ||
} | ||
|
||
if ( ! wp_verify_nonce( $nonce, 'wpmtst-challenge' ) ) { | ||
wp_send_json_error(); | ||
die(); | ||
} | ||
|
||
update_option( 'wpmtst-challenge', 0 ); | ||
wp_send_json_success(); | ||
wp_die(); | ||
} | ||
|
||
} | ||
new ST_Challenge_Modal(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?php | ||
/** | ||
* Class Strong_Testimonials_Addons | ||
* | ||
*/ | ||
class Strong_Testimonials_Lite_vs_PRO_page { | ||
|
||
public function __construct() { | ||
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); | ||
add_filter( 'wpmtst_submenu_pages', array( $this, 'add_submenu' ) ); | ||
|
||
// Upgrade to PRO plugin action link | ||
add_filter( 'plugin_action_links_' . WPMTST_PLUGIN, array( $this, 'filter_action_links' ), 60 ); | ||
} | ||
|
||
/** | ||
* Add the Upgrade to PRO plugin action link | ||
* | ||
* @param $links | ||
* | ||
* @return array | ||
* | ||
* @since 2.51.7 | ||
*/ | ||
public function filter_action_links( $links ) { | ||
|
||
if ( apply_filters( 'st_plugins_upgrade_pro', true ) ) { | ||
|
||
$links = array_merge( array ( '<a target="_blank" class="wpmtst-lite-vs-pro" href="https://strongtestimonials.com/pricing/?utm_source=strong-testimonials-lite&utm_medium=plugin_settings&utm_campaign=upsell">' . esc_html__( 'Upgrade to PRO!', 'strong-testimonials' ) . '</a>' ), $links ); | ||
} | ||
return $links; | ||
} | ||
/** | ||
* Add submenu page. | ||
* | ||
* @param $pages | ||
* | ||
* @return mixed | ||
*/ | ||
public function add_submenu( $pages ) { | ||
$pages[99] = $this->get_submenu(); | ||
return $pages; | ||
} | ||
|
||
public function admin_enqueue_scripts(){ | ||
wp_enqueue_style( 'wpmtst-lite-vs-pro' ); | ||
} | ||
|
||
/** | ||
* Return submenu page parameters. | ||
* | ||
* @return array | ||
*/ | ||
public function get_submenu() { | ||
return array( | ||
'page_title' => esc_html__( 'Lite vs Pro', 'strong-testimonials' ), | ||
'menu_title' => esc_html__( 'Lite vs Pro', 'strong-testimonials' ), | ||
'capability' => 'strong_testimonials_options', | ||
'menu_slug' => 'strong-testimonials-lite-vs-pro', | ||
'function' => array( $this, 'render_page' ), | ||
); | ||
} | ||
|
||
public function render_page(){ | ||
|
||
$addons = new Strong_Testimonials_Addons(); | ||
?> | ||
<div class="wrap wpmtst-lite-vs-premium"> | ||
<hr class="wp-header-end" /> | ||
<h1><?php echo esc_html__( 'LITE vs PRO', 'strong-testimonials' ); ?> </h1> | ||
<div class="free-vs-premium"> | ||
<!-- Table header --> | ||
<div class="wpchill-plans-table table-header"> | ||
<div class="wpchill-pricing-package wpchill-empty"> | ||
<!--This is an empty div so that we can have an empty corner--> | ||
</div> | ||
<div class="wpchill-pricing-package wpchill-title"> | ||
<p class="wpchill-name"><strong>PRO</strong></p> | ||
</div> | ||
<div class="wpchill-pricing-package wpchill-title wpchill-wpmtst-lite"> | ||
<p class="wpchill-name"><strong>LITE</strong></p> | ||
</div> | ||
</div> | ||
<!-- Table content --> | ||
|
||
<?php | ||
foreach ( $addons->get_addons() as $pro ) { | ||
?> | ||
<div class="wpchill-plans-table"> | ||
<div class="wpchill-pricing-package feature-name"> | ||
<h3><?php echo esc_html( $pro['name']); ?></h3> | ||
<p class="tab-header-description wpmtst-tooltip-content"> | ||
<?php echo esc_html( $pro['description'] ); ?> | ||
</p> | ||
</div> | ||
<div class="wpchill-pricing-package"> | ||
<span class="dashicons dashicons-saved"></span> | ||
</div> | ||
<div class="wpchill-pricing-package"> | ||
<span class="dashicons dashicons-no-alt"></span> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
?> | ||
<!-- Support --> | ||
<div class="wpchill-plans-table"> | ||
<div class="wpchill-pricing-package feature-name"> | ||
<h3><?php esc_html_e( 'Support', 'strong-testimonials' ); ?></h3> | ||
</div> | ||
<div class="wpchill-pricing-package">Priority</div> | ||
<div class="wpchill-pricing-package"><a href="https://wordpress.org/support/plugin/strong-testimonials/" | ||
target="_blank">wp.org</a> | ||
</div> | ||
</div> | ||
<!-- Table footer --> | ||
<div class="wpchill-plans-table tabled-footer"> | ||
<div class="wpchill-pricing-package wpchill-empty"> | ||
<!--This is an empty div so that we can have an empty corner--> | ||
</div> | ||
<div class="wpchill-pricing-package wpchill-title wpchill-wpmtst-grid-gallery-business"> | ||
|
||
<a href="https://strongtestimonials.com/pricing/?utm_source=strong-testimonials&utm_medium=lite-vs-pro&utm_campaign=upsell" target="_blank" | ||
class="button button-primary button-hero "><span class="dashicons dashicons-cart"></span> | ||
<?php esc_html_e( 'Upgrade now!', 'strong-testimonials' ); ?> </a> | ||
|
||
</div> | ||
<div class="wpchill-pricing-package wpchill-title wpchill-wpmtst-lite"> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
} | ||
new Strong_Testimonials_Lite_vs_PRO_page(); |
Oops, something went wrong.