Changeset 3105325
- Timestamp:
- 06/20/2024 07:26:50 PM (20 months ago)
- Location:
- wp-jquery-lightbox
- Files:
-
- 6 added
- 2 deleted
- 14 edited
- 1 copied
-
tags/2.2.0 (copied) (copied from wp-jquery-lightbox/trunk)
-
tags/2.2.0/admin/admin-notice.js (added)
-
tags/2.2.0/admin/admin-purchase.js (added)
-
tags/2.2.0/admin/admin-settings.js (added)
-
tags/2.2.0/admin/admin.css (modified) (2 diffs)
-
tags/2.2.0/admin/admin.js (deleted)
-
tags/2.2.0/admin/views/pro-landing-page.php (modified) (3 diffs)
-
tags/2.2.0/class-lightpress.php (modified) (8 diffs)
-
tags/2.2.0/lightboxes/wp-jquery-lightbox/class-wp-jquery-lightbox.php (modified) (5 diffs)
-
tags/2.2.0/lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-options.php (modified) (1 diff)
-
tags/2.2.0/readme.txt (modified) (2 diffs)
-
tags/2.2.0/wp-jquery-lightbox.php (modified) (2 diffs)
-
trunk/admin/admin-notice.js (added)
-
trunk/admin/admin-purchase.js (added)
-
trunk/admin/admin-settings.js (added)
-
trunk/admin/admin.css (modified) (2 diffs)
-
trunk/admin/admin.js (deleted)
-
trunk/admin/views/pro-landing-page.php (modified) (3 diffs)
-
trunk/class-lightpress.php (modified) (8 diffs)
-
trunk/lightboxes/wp-jquery-lightbox/class-wp-jquery-lightbox.php (modified) (5 diffs)
-
trunk/lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-options.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-jquery-lightbox.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-jquery-lightbox/tags/2.2.0/admin/admin.css
r3104196 r3105325 18 18 .lightbox_page_lightpress-pro .lightpress-logo { 19 19 margin-bottom: 0; 20 } 21 22 .lightpress-review-actions .button-primary { 23 padding: 0 12px !important; 24 text-transform: none !important; 25 font-size: 13px !important; 20 26 } 21 27 … … 154 160 border-color: #4fa959; 155 161 color: #fff; 156 }157 158 .toplevel_page_lightpress-settings .wp-core-ui .button-primary {159 160 162 } 161 163 -
wp-jquery-lightbox/tags/2.2.0/admin/views/pro-landing-page.php
r3104692 r3105325 1 1 <?php 2 /** 3 * View: Pro Landing Page 4 * 5 * Renders the markup for the LightPress Pro upgrade page. 6 * 7 * @package LightPress Pro 8 * @author LightPress 9 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 10 */ 2 11 3 12 ?> 4 <img class="lightpress-logo" src="<?php echo LIGHTPRESS_PLUGIN_URL ?>admin/lightpress-logo.png">13 <img class="lightpress-logo" src="<?php echo esc_url( LIGHTPRESS_PLUGIN_URL . 'admin/lightpress-logo.png' ); ?>"/> 5 14 <div class="hero-section"> 6 15 <div class="hero-section-copy"> 7 <p class="hero-section-copy-tag"><?php e cho __( 'LightPress Pro', 'wp-jquery-lightbox' )?></p>8 <h1 class="hero-section-copy-title"><?php e cho __( 'Make your media a highlight of your website.', 'wp-jquery-lightbox' )?></h1>9 <p class="hero-section-copy-text"><?php e cho __( 'Add the brilliant new Pro Lightbox. Fast. Perfect on all devices. Supports images, videos, pdfs, maps, modals with custom content, and more.', 'wp-jquery-lightbox' )?></p>16 <p class="hero-section-copy-tag"><?php esc_html_e( 'LightPress Pro', 'wp-jquery-lightbox' ); ?></p> 17 <h1 class="hero-section-copy-title"><?php esc_html_e( 'Make your media a highlight of your website.', 'wp-jquery-lightbox' ); ?></h1> 18 <p class="hero-section-copy-text"><?php esc_html_e( 'Add the brilliant new Pro Lightbox. Fast. Perfect on all devices. Supports images, videos, pdfs, maps, modals with custom content, and more.', 'wp-jquery-lightbox' ); ?></p> 10 19 <div class="hero-section-actions"> 11 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php e cho __( 'Learn More', 'wp-jquery-lightbox' )?></a>12 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php e cho __( 'See Demos', 'wp-jquery-lightbox' )?></a>20 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php esc_html_e( 'Learn More', 'wp-jquery-lightbox' ); ?></a> 21 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php esc_html_e( 'See Demos', 'wp-jquery-lightbox' ); ?></a> 13 22 </div> 14 <p class="hero-section-copy-under-button"><?php e cho __( 'Or buy directly from the WordPress dashboard below!', 'wp-jquery-lightbox' )?></p>23 <p class="hero-section-copy-under-button"><?php esc_html_e( 'Or buy directly from the WordPress dashboard below!', 'wp-jquery-lightbox' ); ?></p> 15 24 </div> 16 25 <div class="hero-section-image"> 17 26 <figure> 18 <picture><img src="<?php echo LIGHTPRESS_PLUGIN_URL ?>admin/device-mock.jpg" alt="Lightbox display across devices."></picture>27 <picture><img src="<?php echo esc_url( LIGHTPRESS_PLUGIN_URL . 'admin/device-mock.jpg' ); ?>" alt="Lightbox display across devices."></picture> 19 28 </figure> 20 29 </div> … … 22 31 <div class="pricing-section"> 23 32 <div class="sale-notice"> 24 <h1><?php e cho __( '40% Off Launch Sale!', 'wp-jquery-lightbox' )?></h1>25 <p><?php e cho __( 'Celebrate the launch of LightPress Pro!', 'wp-jquery-lightbox' )?></p>26 <p><?php e cho __( 'Use code LIGHTPRESS at checkout for 40% off.', 'wp' )?></p>33 <h1><?php esc_html_e( '40% Off Launch Sale!', 'wp-jquery-lightbox' ); ?></h1> 34 <p><?php esc_html_e( 'Celebrate the launch of LightPress Pro!', 'wp-jquery-lightbox' ); ?></p> 35 <p><?php esc_html_e( 'Use code LIGHTPRESS at checkout for 40% off.', 'wp' ); ?></p> 27 36 </div> 28 37 <div class="pricing-table"> … … 31 40 <div class="plan-cost"><span class="plan-price">$59</span></div> 32 41 <ul class="plan-features"> 33 <li class="strong"><?php e cho __( 'All Features', 'wp-jquery-lightbox' )?></li>34 <li class="strong excluded"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>35 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>36 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>37 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>38 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>39 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>40 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>41 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>42 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>43 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>44 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>45 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>46 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>47 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>48 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>49 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>50 <li class="strong excluded"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>51 <li class="excluded"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>42 <li class="strong"><?php esc_html_e( 'All Features', 'wp-jquery-lightbox' ); ?></li> 43 <li class="strong excluded"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 44 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 45 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 46 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 47 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 48 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 49 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 50 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 51 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 52 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 53 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 54 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 55 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 56 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 57 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 58 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 59 <li class="strong excluded"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 60 <li class="excluded"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 52 61 </ul> 53 62 <div class="plan-select"> 54 63 <div class="plan-select-dropdown"> 55 64 <select id="basic-licenses"> 56 <option value="1"><?php e cho __( '1 Site License', 'wp-jquery-lightbox' )?> ($49)'</option>57 <option value="5" selected="selected"><?php e cho __( '5 Site License', 'wp-jquery-lightbox' )?> ($59)</option>58 <option value="25"><?php e cho __( '25 Site License', 'wp-jquery-lightbox' )?> ($139)</option>65 <option value="1"><?php esc_html_e( '1 Site License', 'wp-jquery-lightbox' ); ?> ($49)'</option> 66 <option value="5" selected="selected"><?php esc_html_e( '5 Site License', 'wp-jquery-lightbox' ); ?> ($59)</option> 67 <option value="25"><?php esc_html_e( '25 Site License', 'wp-jquery-lightbox' ); ?> ($139)</option> 59 68 </select> 60 69 </div> 61 <button id="basic-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>70 <button id="basic-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 62 71 </div> 63 72 </div> 64 73 <div class="plan featured"> 65 <h3 class="plan-title">Pro<span class="most-popular"><?php e cho __( 'Most Popular!', 'wp-jquery-lightbox' )?></span></h3>74 <h3 class="plan-title">Pro<span class="most-popular"><?php esc_html_e( 'Most Popular!', 'wp-jquery-lightbox' ); ?></span></h3> 66 75 <div class="plan-cost"><span class="plan-price">$99</span></div> 67 76 <ul class="plan-features"> 68 <li class="strong"><?php e cho __( 'All Features + Support', 'wp-jquery-lightbox' )?></li>69 <li class="strong included"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>70 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>71 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>72 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>73 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>74 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>75 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>76 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>77 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>78 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>79 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>80 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>81 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>82 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>83 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>84 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>85 <li class="strong excluded"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>86 <li class="excluded"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>77 <li class="strong"><?php esc_html_e( 'All Features + Support', 'wp-jquery-lightbox' ); ?></li> 78 <li class="strong included"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 79 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 80 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 81 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 82 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 83 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 84 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 85 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 86 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 87 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 88 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 89 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 90 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 91 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 92 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 93 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 94 <li class="strong excluded"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 95 <li class="excluded"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 87 96 </ul> 88 97 <div class="plan-select"> 89 98 <div class="plan-select-dropdown"> 90 99 <select id="pro-licenses"> 91 <option value="1"><?php e cho __( '1 Site License', 'wp-jquery-lightbox' )?> ($79)</option>92 <option value="5" selected="selected"><?php e cho __( '5 Site License', 'wp-jquery-lightbox' )?> ($99)</option>93 <option value="25"><?php e cho __( '25 Site License', 'wp-jquery-lightbox' )?> ($179)</option>100 <option value="1"><?php esc_html_e( '1 Site License', 'wp-jquery-lightbox' ); ?> ($79)</option> 101 <option value="5" selected="selected"><?php esc_html_e( '5 Site License', 'wp-jquery-lightbox' ); ?> ($99)</option> 102 <option value="25"><?php esc_html_e( '25 Site License', 'wp-jquery-lightbox' ); ?> ($179)</option> 94 103 </select> 95 104 </div> 96 <button id="pro-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>105 <button id="pro-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 97 106 </div> 98 107 </div> 99 108 <div class="plan"> 100 109 <h3 class="plan-title">Enterprise</h3> 101 <div class="plan-cost"><span class="plan-price">$ 899</span></div>110 <div class="plan-cost"><span class="plan-price">$499</span></div> 102 111 <ul class="plan-features"> 103 <li class="strong"><?php e cho __( 'Unlimited', 'wp-jquery-lightbox' )?></li>104 <li class="strong included"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>105 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>106 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>107 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>108 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>109 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>110 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>111 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>112 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>113 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>114 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>115 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>116 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>117 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>118 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>119 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>120 <li class="strong included"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>121 <li class="included"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>112 <li class="strong"><?php esc_html_e( 'Unlimited', 'wp-jquery-lightbox' ); ?></li> 113 <li class="strong included"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 114 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 115 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 116 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 117 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 118 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 119 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 120 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 121 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 122 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 123 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 124 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 125 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 126 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 127 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 128 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 129 <li class="strong included"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 130 <li class="included"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 122 131 </ul> 123 132 <div class="plan-select"> 124 133 <div class="plan-select-dropdown"> 125 134 <select id="enterprise-licenses"> 126 <option value="1"><?php echo __( '1 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 127 <option value="5" selected="selected"><?php echo __( '5 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 128 <option value="25" selected="selected"><?php echo __( '25 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 135 <option value="unlimited"><?php esc_html_e( 'Unlimited Sites', 'easy-fancybox' ); ?> ($499)</option> 129 136 </select> 130 137 </div> 131 <button id="enterprise-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>138 <button id="enterprise-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 132 139 </div> 133 140 </div> -
wp-jquery-lightbox/tags/2.2.0/class-lightpress.php
r3104692 r3105325 75 75 */ 76 76 public function __construct() { 77 // Frontend & Admin.78 77 self::$active_lightbox = get_option( 'lightpress_active_lightbox', 'wp-jquery-lightbox' ); 79 78 load_plugin_textdomain( 'wp-jquery-lightbox', false, LIGHTPRESS_PLUGIN_DIR . 'languages/' ); … … 86 85 add_action( 'admin_init', array( $this, 'add_plugin_settings' ) ); 87 86 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) ); 87 add_action( 'admin_notices', array( $this, 'show_review_request' ) ); 88 add_action( 'wp_ajax_lightpress-review-action', array( $this, 'process_lightpress_review_action' ) ); 88 89 } 89 90 … … 108 109 85 109 110 ); 110 if ( self::$show_pro_screen && ! class_exists( 'LightPress Pro' ) ) {111 if ( self::$show_pro_screen && ! class_exists( 'LightPress_Pro' ) ) { 111 112 add_submenu_page( 112 113 'lightpress-settings', … … 168 169 <?php 169 170 /* translators: %1$s is replaced with a link, ie <a> tag */ 170 printf( esc_html__( 'The WP JQuery Lightbox is now the LightPress Lightbox. Settings are now %1$s.', 'wp-jquery-lightbox' ), '<strong><a href="' . esc_url( admin_url( 'admin.php?page=lightpress-settings' ) ) . '">' . esc_html__( 'here', ' easy-fancybox' ) . '</a></strong>' );171 printf( esc_html__( 'The WP JQuery Lightbox is now the LightPress Lightbox. Settings are now %1$s.', 'wp-jquery-lightbox' ), '<strong><a href="' . esc_url( admin_url( 'admin.php?page=lightpress-settings' ) ) . '">' . esc_html__( 'here', 'wp-jquery-lightbox' ) . '</a></strong>' ); 171 172 ?> 172 173 </p> … … 213 214 add_settings_field( 214 215 'lightpress_active_lightbox', 215 __( 'Choose Lighbox', ' easy-fancybox' ),216 __( 'Choose Lighbox', 'wp-jquery-lightbox' ), 216 217 array( __CLASS__, 'render_choose_lightbox_field' ), 217 218 'lightpress-settings', … … 240 241 </select> 241 242 <span class="description"> 242 <?php echo esc_html__( 'Additional settings for the selected lightbox will appear below.', ' easy-fancybox' ); ?>243 <?php echo esc_html__( 'Additional settings for the selected lightbox will appear below.', 'wp-jquery-lightbox' ); ?> 243 244 </span> 244 245 <?php … … 396 397 */ 397 398 public function enqueue_admin_assets() { 398 $screen = get_current_screen(); 399 $should_load_js = 400 'dashboard' === $screen->id || 401 self::$settings_screen_id === $screen->id || 402 self::$pro_screen_id === $screen->id; 403 404 if ( $should_load_js ) { 405 $css_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.css'; 406 wp_register_style( 'lightpress-admin-css', $css_file, false, LIGHTPRESS_VERSION ); 399 $screen = get_current_screen(); 400 $is_lightpress_settings = self::$settings_screen_id === $screen->id; 401 $is_pro_landing = self::$pro_screen_id === $screen->id; 402 $is_dashboard = 'dashboard' === $screen->id; 403 $freemius_js = 'https://checkout.freemius.com/checkout.min.js'; 404 $purchase_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-purchase.js'; 405 $settings_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-settings.js'; 406 $notice_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-notice.js'; 407 $css_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.css'; 408 $version = defined( 'WP_DEBUG' ) ? time() : EASY_FANCYBOX_PRO_VERSION; 409 410 if ( $is_pro_landing ) { 411 wp_register_script( 'lightpress-freemius-js', $freemius_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 412 wp_register_script( 'lightpress-purchase-js', $purchase_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 413 wp_enqueue_script( 'lightpress-freemius-js' ); 414 wp_enqueue_script( 'lightpress-purchase-js' ); 415 } 416 417 if ( $is_lightpress_settings ) { 418 wp_register_script( 'lightpress-settings-js', $settings_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 419 wp_enqueue_script( 'lightpress-settings-js' ); 420 } 421 422 if ( $is_lightpress_settings || $is_dashboard ) { 423 wp_register_script( 'lightpress-notice-js', $notice_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 424 wp_enqueue_script( 'lightpress-notice-js' ); 425 } 426 427 if ( $is_lightpress_settings || $is_pro_landing || $is_dashboard ) { 428 wp_register_style( 'lightpress-admin-css', $css_file, false, $version ); 407 429 wp_enqueue_style( 'lightpress-admin-css' ); 408 409 $js_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.js'; 410 wp_register_script( 'lightpress-admin-js', $js_file, array( 'jquery', 'wp-dom-ready' ), LIGHTPRESS_VERSION, true ); 411 wp_enqueue_script( 'lightpress-admin-js' ); 412 } 413 414 // Localize var to admin JS. 430 } 431 415 432 wp_localize_script( 416 'lightpress- admin-js',417 ' lightpress',433 'lightpress-settings-js', 434 'settings', 418 435 array( 419 'pro AdminUrl' => admin_url( 'admin.php?page=lightpress-pro' ),436 'proLandingUrl' => admin_url( 'admin.php?page=lightpress-pro' ), 420 437 ) 421 438 ); … … 439 456 update_option( 'jqlb_date', $now_as_string ); 440 457 } 458 459 /** 460 * Determine if the review request should be shown. 461 * 462 * To summarize, this will only show: 463 * if is options screen and 464 * if has not already been rated and 465 * if user is selected for metered rollout and 466 * if user has plugin more than 60 days and 467 * if use has not interacted with reviews within 90 days. 468 * 469 * @access public 470 * 471 * @return bool Returns true if the review request should be shown, false otherwise. 472 */ 473 public function should_show_review_request() { 474 // Don't show if not on options screen or dashboard, or if already rated. 475 $screen = get_current_screen(); 476 $is_dashboard_or_plugin_options = 'dashboard' === $screen->id || self::$settings_screen_id === $screen->id; 477 $already_rated = get_option( 'lightpress_plugin_rated' ) && get_option( 'lightpress_plugin_rated' ) === 'true'; 478 479 if ( ! $is_dashboard_or_plugin_options || $already_rated ) { 480 return false; 481 } 482 483 // Limit review notices to 10% of users initially. 484 $user_review_number = get_option( 'lightpress_user_review_number' ); 485 if ( ! $user_review_number ) { 486 $user_review_number = rand( 1, 10 ); // phpcs:ignore 487 update_option( 'lightpress_user_review_number', $user_review_number ); 488 } 489 $selected = '1' === $user_review_number || '2' === $user_review_number || '3' === $user_review_number || '4' === $user_review_number; 490 if ( ! $selected ) { 491 return false; 492 } 493 494 // Only show if user has been using plugin for more than 60 days. 495 $current_date = new DateTimeImmutable( gmdate( 'Y-m-d' ) ); 496 $plugin_time_stamp = get_option( 'jqlb_date' ); 497 $activation_date = $plugin_time_stamp 498 ? new DateTimeImmutable( $plugin_time_stamp ) 499 : $current_date; 500 $days_using_plugin = $activation_date->diff( $current_date )->days; 501 if ( $days_using_plugin < 60 ) { 502 return false; 503 } 504 505 // Do not show if user interacted with reviews within last 90 days. 506 $lightpress_last_review_interaction = get_option( 'lightpress_last_review_interaction' ); 507 if ( $lightpress_last_review_interaction ) { 508 $last_review_interaction_date = new DateTimeImmutable( $lightpress_last_review_interaction ); 509 $days_since_last_interaction = $last_review_interaction_date->diff( $current_date )->days; 510 if ( $days_since_last_interaction < 90 ) { 511 return false; 512 } 513 } 514 515 return true; 516 } 517 518 /** 519 * Render the review request to the user. 520 * 521 * @since 1.0.0 522 * @access public 523 * 524 * @return void 525 */ 526 public function show_review_request() { 527 if ( $this->should_show_review_request() ) { 528 ?> 529 <div class="notice notice-success is-dismissible lightpress-review-notice"> 530 <p><?php esc_html_e( 'You\'ve been using LightPress (WP JQuery Lightbox) for a long time! Awesome and thanks!', 'wp-jquery-lightbox' ); ?></p> 531 <p> 532 <?php 533 printf( 534 __( 'We work hard to maintain it - for over 10 years! Would you do us a BIG favor and give us a 5-star review on WordPress.org? Or share feedback <a %s>here</a>.', 'wp-jquery-lightbox' ), // phpcs:ignore 535 'href="https://lightpress.io/contact/" target="_blank"' 536 ); 537 ?> 538 </p> 539 540 <ul class="lightpress-review-actions" data-nonce="<?php echo esc_attr( wp_create_nonce( 'lightpress_review_action_nonce' ) ); ?>"> 541 <li style="display:inline;"><a class="button-primary" data-rate-action="do-rate" 542 href="https://wordpress.org/support/plugin/wp-jquery-lightbox/reviews/#new-post" target="_blank"><?php esc_html_e( 'Ok, you deserve it!', 'wp' ); ?></a> 543 </li> 544 <li style="display:inline;"><a class="button-secondary" data-rate-action="maybe-later" href="#"><?php esc_html_e( 'Maybe later', 'wp-jquery-lightbox' ); ?></a></li> 545 <li style="display:inline;"><a class="button-secondary" data-rate-action="done" href="#"><?php esc_html_e( 'Already did!', 'wp-jquery-lightbox' ); ?></a></li> 546 </ul> 547 </div> 548 549 <?php 550 } 551 } 552 553 /** 554 * Process Ajax request when user interacts with review requests 555 */ 556 public function process_lightpress_review_action() { 557 check_admin_referer( 'lightpress_review_action_nonce', '_n' ); 558 if ( ! current_user_can( 'manage_options' ) ) { 559 return; 560 } 561 562 $rate_action = isset( $_POST['rate_action'] ) 563 ? sanitize_text_field( wp_unslash( $_POST['rate_action'] ) ) 564 : ''; 565 $current_date = new DateTimeImmutable( gmdate( 'Y-m-d' ) ); 566 $current_date_as_string = $current_date->format( 'Y-m-d' ); 567 update_option( 'lightpress_last_review_interaction', $current_date_as_string ); 568 569 if ( 'done' === $rate_action ) { 570 update_option( 'lightpress_plugin_rated', 'true' ); 571 } 572 573 exit; 574 } 575 576 /** 577 * Disables/hides core lightbox for editor > image blocks. 578 * 579 * Helper function designed to be used by individual lightboxes 580 * to disable core lightbox if they offer that option. 581 * 582 * @param array $theme_json Theme json to filter. 583 * @return array $theme_json Filtered theme json. 584 */ 585 public static function hide_core_lightbox_in_editor( $theme_json ) { 586 $new_data = array( 587 'version' => 2, 588 'settings' => array( 589 'blocks' => array( 590 'core/image' => array( 591 'lightbox' => array( 592 'allowEditing' => false, 593 'enabled' => false, 594 ), 595 ), 596 ), 597 ), 598 ); 599 return $theme_json->update_with( $new_data ); 600 } 601 602 /** 603 * Removes filter and dequeues JS for core lightbox. 604 * 605 * Helper function designed to be used by individual lightboxes 606 * to disable core lightbox if they offer that option. 607 */ 608 public static function disable_core_lightbox_on_frontend() { 609 // These are added for the core lightbox here: 610 // https://github.com/WordPress/gutenberg/blob/8dc36f6d30cc163671bdaa33f0656fdfe91f1447/packages/block-library/src/image/index.php#L64 . 611 if ( function_exists( 'wp_dequeue_script_module' ) ) { 612 wp_dequeue_script_module( '@wordpress/block-library/image' ); 613 } 614 remove_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15 ); 615 remove_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15, 2 ); 616 } 441 617 } -
wp-jquery-lightbox/tags/2.2.0/lightboxes/wp-jquery-lightbox/class-wp-jquery-lightbox.php
r3104692 r3105325 35 35 36 36 /** 37 * Is this lightbox active? 38 * 39 * @var bool 40 */ 41 public $is_active_lightbox = false; 42 43 /** 37 44 * The group of the lightbox 38 45 * … … 64 71 */ 65 72 public function __construct() { 73 $this->is_active_lightbox = LightPress::$active_lightbox === $this->lightbox_slug; 74 66 75 // Frontend. 67 if ( ! is_admin() && LightPress::$active_lightbox === $this->lightbox_slug) {76 if ( ! is_admin() && $this->is_active_lightbox ) { 68 77 add_action( 'wp_print_styles', array( $this, 'enqueue_css' ) ); 69 78 add_action( 'wp_print_scripts', array( $this, 'enqueue_js' ) ); … … 74 83 add_filter( 'comment_text', array( $this, 'lightbox_comment' ), 99 ); 75 84 } 85 if ( $this->should_disable_core_lightbox() ) { 86 add_action( 'wp_enqueue_scripts', 'LightPress::disable_core_lightbox_on_frontend', 99 ); 87 } 76 88 } 77 89 … … 79 91 if ( is_admin() ) { 80 92 add_action( 'admin_init', array( $this, 'add_lightbox_settings' ) ); 81 if ( LightPress::$active_lightbox === $this->lightbox_slug) {93 if ( $this->is_active_lightbox ) { 82 94 add_filter( 'image_send_to_editor', array( $this, 'remove_rel' ), 10, 2 ); 95 if ( $this->should_disable_core_lightbox() ) { 96 add_filter( 'wp_theme_json_data_user', 'LightPress::hide_core_lightbox_in_editor' ); 97 } 83 98 } 84 99 } … … 398 413 return $this->filter_content( $comment ); 399 414 } 415 416 /** 417 * Determines if we should disable core lightbox. 418 * 419 * @return bool True if we should disable core lightbox. 420 */ 421 public function should_disable_core_lightbox() { 422 global $wp_version; 423 $is_supported_wp_version = isset( $wp_version ) && version_compare( $wp_version, '6.5.0' ) >= 0; 424 $is_disabled = get_option( 'jqlb_disable_core_lightbox', true ); 425 426 if ( $is_supported_wp_version && $this->is_active_lightbox && $is_disabled ) { 427 return true; 428 } 429 430 return false; 431 } 400 432 } -
wp-jquery-lightbox/tags/2.2.0/lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-options.php
r3104692 r3105325 229 229 ), 230 230 array( 231 'id' => 'jqlb_disable_core_lightbox', 232 'title' => __( 'Disable Core Lightbox', 'lightpress-pro' ), 233 'input' => 'checkbox', 234 'sanitize_callback' => 'wp_validate_boolean', 235 'default' => '1', 236 'section' => 'lightpress-jqlb-settings-section', 237 'description' => __( 'Disable the core lightbox when lightbox is active.', 'wp-jquery-lightbox' ), 238 ), 239 array( 231 240 'id' => 'jqlb_pinchzoom', 232 241 'title' => __( 'Enable Mobile Pinchzoom', 'wp-jquery-lightbox' ), -
wp-jquery-lightbox/tags/2.2.0/readme.txt
r3104692 r3105325 4 4 Requires at least: 5.0 5 5 Tested up to: 6.5.4 6 Stable tag: 2. 1.06 Stable tag: 2.2.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 114 114 115 115 == Changelog == 116 117 = 2.2.0 (2024-06-20) = 118 * Add review requests 119 * Add option to disable core lightbox 120 * Change how plugin is instantiated 116 121 117 122 = 2.1.0 (2024-06-19) = -
wp-jquery-lightbox/tags/2.2.0/wp-jquery-lightbox.php
r3104692 r3105325 4 4 * Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/ 5 5 * Description: Simple and lightweight lightbox for galleries and images. Formerly WP Jquery Lightbox. 6 * Version: 2. 1.06 * Version: 2.2.0 7 7 * Text Domain: wp-jquery-lightbox 8 8 * Author: LightPress … … 23 23 * Define constants. 24 24 */ 25 define( 'LIGHTPRESS_VERSION', '2. 1.0' );25 define( 'LIGHTPRESS_VERSION', '2.2.0' ); 26 26 define( 'LIGHTPRESS_PLUGIN_BASE', plugin_basename( __FILE__ ) ); 27 27 define( 'LIGHTPRESS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); // Includes ending slash. 28 28 define( 'LIGHTPRESS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // Includes ending slash. 29 29 30 /** 31 * Instantiate plugin. 32 * 33 * NOTE: PLUGIN DEPENDENCY 34 * We load this on plugins_loaded with priority 10. 35 * LightPress Pro depends on this plugin, and loads 36 * on plugins_loaded with priority 20. 37 */ 30 38 if ( defined( 'JQLB_LEGACY' ) && true === JQLB_LEGACY ) { 31 39 require_once LIGHTPRESS_PLUGIN_DIR . 'lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-legacy.php'; 32 40 } else { 33 41 require_once LIGHTPRESS_PLUGIN_DIR . 'class-lightpress.php'; 34 new LightPress();42 add_action( 'plugins_loaded', 'LightPress::get_instance', 10 ); 35 43 } -
wp-jquery-lightbox/trunk/admin/admin.css
r3104196 r3105325 18 18 .lightbox_page_lightpress-pro .lightpress-logo { 19 19 margin-bottom: 0; 20 } 21 22 .lightpress-review-actions .button-primary { 23 padding: 0 12px !important; 24 text-transform: none !important; 25 font-size: 13px !important; 20 26 } 21 27 … … 154 160 border-color: #4fa959; 155 161 color: #fff; 156 }157 158 .toplevel_page_lightpress-settings .wp-core-ui .button-primary {159 160 162 } 161 163 -
wp-jquery-lightbox/trunk/admin/views/pro-landing-page.php
r3104692 r3105325 1 1 <?php 2 /** 3 * View: Pro Landing Page 4 * 5 * Renders the markup for the LightPress Pro upgrade page. 6 * 7 * @package LightPress Pro 8 * @author LightPress 9 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 10 */ 2 11 3 12 ?> 4 <img class="lightpress-logo" src="<?php echo LIGHTPRESS_PLUGIN_URL ?>admin/lightpress-logo.png">13 <img class="lightpress-logo" src="<?php echo esc_url( LIGHTPRESS_PLUGIN_URL . 'admin/lightpress-logo.png' ); ?>"/> 5 14 <div class="hero-section"> 6 15 <div class="hero-section-copy"> 7 <p class="hero-section-copy-tag"><?php e cho __( 'LightPress Pro', 'wp-jquery-lightbox' )?></p>8 <h1 class="hero-section-copy-title"><?php e cho __( 'Make your media a highlight of your website.', 'wp-jquery-lightbox' )?></h1>9 <p class="hero-section-copy-text"><?php e cho __( 'Add the brilliant new Pro Lightbox. Fast. Perfect on all devices. Supports images, videos, pdfs, maps, modals with custom content, and more.', 'wp-jquery-lightbox' )?></p>16 <p class="hero-section-copy-tag"><?php esc_html_e( 'LightPress Pro', 'wp-jquery-lightbox' ); ?></p> 17 <h1 class="hero-section-copy-title"><?php esc_html_e( 'Make your media a highlight of your website.', 'wp-jquery-lightbox' ); ?></h1> 18 <p class="hero-section-copy-text"><?php esc_html_e( 'Add the brilliant new Pro Lightbox. Fast. Perfect on all devices. Supports images, videos, pdfs, maps, modals with custom content, and more.', 'wp-jquery-lightbox' ); ?></p> 10 19 <div class="hero-section-actions"> 11 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php e cho __( 'Learn More', 'wp-jquery-lightbox' )?></a>12 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php e cho __( 'See Demos', 'wp-jquery-lightbox' )?></a>20 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php esc_html_e( 'Learn More', 'wp-jquery-lightbox' ); ?></a> 21 <a class="pro-action-button" href="https://lightpress.io/pro-lightbox" target="_blank"><?php esc_html_e( 'See Demos', 'wp-jquery-lightbox' ); ?></a> 13 22 </div> 14 <p class="hero-section-copy-under-button"><?php e cho __( 'Or buy directly from the WordPress dashboard below!', 'wp-jquery-lightbox' )?></p>23 <p class="hero-section-copy-under-button"><?php esc_html_e( 'Or buy directly from the WordPress dashboard below!', 'wp-jquery-lightbox' ); ?></p> 15 24 </div> 16 25 <div class="hero-section-image"> 17 26 <figure> 18 <picture><img src="<?php echo LIGHTPRESS_PLUGIN_URL ?>admin/device-mock.jpg" alt="Lightbox display across devices."></picture>27 <picture><img src="<?php echo esc_url( LIGHTPRESS_PLUGIN_URL . 'admin/device-mock.jpg' ); ?>" alt="Lightbox display across devices."></picture> 19 28 </figure> 20 29 </div> … … 22 31 <div class="pricing-section"> 23 32 <div class="sale-notice"> 24 <h1><?php e cho __( '40% Off Launch Sale!', 'wp-jquery-lightbox' )?></h1>25 <p><?php e cho __( 'Celebrate the launch of LightPress Pro!', 'wp-jquery-lightbox' )?></p>26 <p><?php e cho __( 'Use code LIGHTPRESS at checkout for 40% off.', 'wp' )?></p>33 <h1><?php esc_html_e( '40% Off Launch Sale!', 'wp-jquery-lightbox' ); ?></h1> 34 <p><?php esc_html_e( 'Celebrate the launch of LightPress Pro!', 'wp-jquery-lightbox' ); ?></p> 35 <p><?php esc_html_e( 'Use code LIGHTPRESS at checkout for 40% off.', 'wp' ); ?></p> 27 36 </div> 28 37 <div class="pricing-table"> … … 31 40 <div class="plan-cost"><span class="plan-price">$59</span></div> 32 41 <ul class="plan-features"> 33 <li class="strong"><?php e cho __( 'All Features', 'wp-jquery-lightbox' )?></li>34 <li class="strong excluded"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>35 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>36 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>37 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>38 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>39 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>40 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>41 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>42 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>43 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>44 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>45 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>46 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>47 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>48 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>49 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>50 <li class="strong excluded"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>51 <li class="excluded"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>42 <li class="strong"><?php esc_html_e( 'All Features', 'wp-jquery-lightbox' ); ?></li> 43 <li class="strong excluded"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 44 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 45 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 46 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 47 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 48 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 49 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 50 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 51 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 52 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 53 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 54 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 55 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 56 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 57 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 58 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 59 <li class="strong excluded"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 60 <li class="excluded"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 52 61 </ul> 53 62 <div class="plan-select"> 54 63 <div class="plan-select-dropdown"> 55 64 <select id="basic-licenses"> 56 <option value="1"><?php e cho __( '1 Site License', 'wp-jquery-lightbox' )?> ($49)'</option>57 <option value="5" selected="selected"><?php e cho __( '5 Site License', 'wp-jquery-lightbox' )?> ($59)</option>58 <option value="25"><?php e cho __( '25 Site License', 'wp-jquery-lightbox' )?> ($139)</option>65 <option value="1"><?php esc_html_e( '1 Site License', 'wp-jquery-lightbox' ); ?> ($49)'</option> 66 <option value="5" selected="selected"><?php esc_html_e( '5 Site License', 'wp-jquery-lightbox' ); ?> ($59)</option> 67 <option value="25"><?php esc_html_e( '25 Site License', 'wp-jquery-lightbox' ); ?> ($139)</option> 59 68 </select> 60 69 </div> 61 <button id="basic-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>70 <button id="basic-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 62 71 </div> 63 72 </div> 64 73 <div class="plan featured"> 65 <h3 class="plan-title">Pro<span class="most-popular"><?php e cho __( 'Most Popular!', 'wp-jquery-lightbox' )?></span></h3>74 <h3 class="plan-title">Pro<span class="most-popular"><?php esc_html_e( 'Most Popular!', 'wp-jquery-lightbox' ); ?></span></h3> 66 75 <div class="plan-cost"><span class="plan-price">$99</span></div> 67 76 <ul class="plan-features"> 68 <li class="strong"><?php e cho __( 'All Features + Support', 'wp-jquery-lightbox' )?></li>69 <li class="strong included"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>70 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>71 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>72 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>73 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>74 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>75 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>76 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>77 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>78 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>79 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>80 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>81 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>82 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>83 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>84 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>85 <li class="strong excluded"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>86 <li class="excluded"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>77 <li class="strong"><?php esc_html_e( 'All Features + Support', 'wp-jquery-lightbox' ); ?></li> 78 <li class="strong included"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 79 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 80 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 81 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 82 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 83 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 84 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 85 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 86 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 87 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 88 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 89 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 90 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 91 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 92 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 93 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 94 <li class="strong excluded"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 95 <li class="excluded"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 87 96 </ul> 88 97 <div class="plan-select"> 89 98 <div class="plan-select-dropdown"> 90 99 <select id="pro-licenses"> 91 <option value="1"><?php e cho __( '1 Site License', 'wp-jquery-lightbox' )?> ($79)</option>92 <option value="5" selected="selected"><?php e cho __( '5 Site License', 'wp-jquery-lightbox' )?> ($99)</option>93 <option value="25"><?php e cho __( '25 Site License', 'wp-jquery-lightbox' )?> ($179)</option>100 <option value="1"><?php esc_html_e( '1 Site License', 'wp-jquery-lightbox' ); ?> ($79)</option> 101 <option value="5" selected="selected"><?php esc_html_e( '5 Site License', 'wp-jquery-lightbox' ); ?> ($99)</option> 102 <option value="25"><?php esc_html_e( '25 Site License', 'wp-jquery-lightbox' ); ?> ($179)</option> 94 103 </select> 95 104 </div> 96 <button id="pro-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>105 <button id="pro-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 97 106 </div> 98 107 </div> 99 108 <div class="plan"> 100 109 <h3 class="plan-title">Enterprise</h3> 101 <div class="plan-cost"><span class="plan-price">$ 899</span></div>110 <div class="plan-cost"><span class="plan-price">$499</span></div> 102 111 <ul class="plan-features"> 103 <li class="strong"><?php e cho __( 'Unlimited', 'wp-jquery-lightbox' )?></li>104 <li class="strong included"><?php e cho __( 'PRO SUPPORT', 'wp-jquery-lightbox' )?></li>105 <li class="strong included"><?php e cho __( 'PLUGIN UPDATES', 'wp-jquery-lightbox' )?></li>106 <li class="strong included"><?php e cho __( 'PRO LIGHTBOX', 'wp-jquery-lightbox' )?></li>107 <li class="included"><?php e cho __( 'All Customization Options', 'wp-jquery-lightbox' )?></li>108 <li class="included"><?php e cho __( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' )?></li>109 <li class="included"><?php e cho __( 'Toolbar Controls', 'wp-jquery-lightbox' )?></li>110 <li class="included"><?php e cho __( 'Slidesshow & Transitions', 'wp-jquery-lightbox' )?></li>111 <li class="included"><?php e cho __( 'Fullscreen', 'wp-jquery-lightbox' )?></li>112 <li class="included"><?php e cho __( 'Image Zooming', 'wp-jquery-lightbox' )?></li>113 <li class="included"><?php e cho __( 'Open Video', 'wp-jquery-lightbox' )?></li>114 <li class="included"><?php e cho __( 'Open PDFs', 'wp-jquery-lightbox' )?></li>115 <li class="included"><?php e cho __( 'Create Modals/Popups', 'wp-jquery-lightbox' )?></li>116 <li class="included"><?php e cho __( 'Open Inline Content', 'wp-jquery-lightbox' )?></li>117 <li class="included"><?php e cho __( 'Open Iframes', 'wp-jquery-lightbox' )?></li>118 <li class="included"><?php e cho __( 'Open Maps', 'wp-jquery-lightbox' )?></li>119 <li class="included"><?php e cho __( 'Performance Optimizations', 'wp-jquery-lightbox' )?></li>120 <li class="strong included"><?php e cho __( 'UNLIMITED', 'wp-jquery-lightbox' )?></li>121 <li class="included"><?php e cho __( 'Unlimited Sites', 'wp-jquery-lightbox' )?></li>112 <li class="strong"><?php esc_html_e( 'Unlimited', 'wp-jquery-lightbox' ); ?></li> 113 <li class="strong included"><?php esc_html_e( 'PRO SUPPORT', 'wp-jquery-lightbox' ); ?></li> 114 <li class="strong included"><?php esc_html_e( 'PLUGIN UPDATES', 'wp-jquery-lightbox' ); ?></li> 115 <li class="strong included"><?php esc_html_e( 'PRO LIGHTBOX', 'wp-jquery-lightbox' ); ?></li> 116 <li class="included"><?php esc_html_e( 'All Customization Options', 'wp-jquery-lightbox' ); ?></li> 117 <li class="included"><?php esc_html_e( 'Thumbnails in Lightbox', 'wp-jquery-lightbox' ); ?></li> 118 <li class="included"><?php esc_html_e( 'Toolbar Controls', 'wp-jquery-lightbox' ); ?></li> 119 <li class="included"><?php esc_html_e( 'Slidesshow & Transitions', 'wp-jquery-lightbox' ); ?></li> 120 <li class="included"><?php esc_html_e( 'Fullscreen', 'wp-jquery-lightbox' ); ?></li> 121 <li class="included"><?php esc_html_e( 'Image Zooming', 'wp-jquery-lightbox' ); ?></li> 122 <li class="included"><?php esc_html_e( 'Open Video', 'wp-jquery-lightbox' ); ?></li> 123 <li class="included"><?php esc_html_e( 'Open PDFs', 'wp-jquery-lightbox' ); ?></li> 124 <li class="included"><?php esc_html_e( 'Create Modals/Popups', 'wp-jquery-lightbox' ); ?></li> 125 <li class="included"><?php esc_html_e( 'Open Inline Content', 'wp-jquery-lightbox' ); ?></li> 126 <li class="included"><?php esc_html_e( 'Open Iframes', 'wp-jquery-lightbox' ); ?></li> 127 <li class="included"><?php esc_html_e( 'Open Maps', 'wp-jquery-lightbox' ); ?></li> 128 <li class="included"><?php esc_html_e( 'Performance Optimizations', 'wp-jquery-lightbox' ); ?></li> 129 <li class="strong included"><?php esc_html_e( 'UNLIMITED', 'wp-jquery-lightbox' ); ?></li> 130 <li class="included"><?php esc_html_e( 'Unlimited Sites', 'wp-jquery-lightbox' ); ?></li> 122 131 </ul> 123 132 <div class="plan-select"> 124 133 <div class="plan-select-dropdown"> 125 134 <select id="enterprise-licenses"> 126 <option value="1"><?php echo __( '1 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 127 <option value="5" selected="selected"><?php echo __( '5 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 128 <option value="25" selected="selected"><?php echo __( '25 Site License', 'wp-jquery-lightbox' )?> ($899)</option> 135 <option value="unlimited"><?php esc_html_e( 'Unlimited Sites', 'easy-fancybox' ); ?> ($499)</option> 129 136 </select> 130 137 </div> 131 <button id="enterprise-purchase" class="pro-action-button"><?php e cho __( 'Buy Now', 'wp-jquery-lightbox' )?></button>138 <button id="enterprise-purchase" class="pro-action-button"><?php esc_html_e( 'Buy Now', 'wp-jquery-lightbox' ); ?></button> 132 139 </div> 133 140 </div> -
wp-jquery-lightbox/trunk/class-lightpress.php
r3104692 r3105325 75 75 */ 76 76 public function __construct() { 77 // Frontend & Admin.78 77 self::$active_lightbox = get_option( 'lightpress_active_lightbox', 'wp-jquery-lightbox' ); 79 78 load_plugin_textdomain( 'wp-jquery-lightbox', false, LIGHTPRESS_PLUGIN_DIR . 'languages/' ); … … 86 85 add_action( 'admin_init', array( $this, 'add_plugin_settings' ) ); 87 86 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) ); 87 add_action( 'admin_notices', array( $this, 'show_review_request' ) ); 88 add_action( 'wp_ajax_lightpress-review-action', array( $this, 'process_lightpress_review_action' ) ); 88 89 } 89 90 … … 108 109 85 109 110 ); 110 if ( self::$show_pro_screen && ! class_exists( 'LightPress Pro' ) ) {111 if ( self::$show_pro_screen && ! class_exists( 'LightPress_Pro' ) ) { 111 112 add_submenu_page( 112 113 'lightpress-settings', … … 168 169 <?php 169 170 /* translators: %1$s is replaced with a link, ie <a> tag */ 170 printf( esc_html__( 'The WP JQuery Lightbox is now the LightPress Lightbox. Settings are now %1$s.', 'wp-jquery-lightbox' ), '<strong><a href="' . esc_url( admin_url( 'admin.php?page=lightpress-settings' ) ) . '">' . esc_html__( 'here', ' easy-fancybox' ) . '</a></strong>' );171 printf( esc_html__( 'The WP JQuery Lightbox is now the LightPress Lightbox. Settings are now %1$s.', 'wp-jquery-lightbox' ), '<strong><a href="' . esc_url( admin_url( 'admin.php?page=lightpress-settings' ) ) . '">' . esc_html__( 'here', 'wp-jquery-lightbox' ) . '</a></strong>' ); 171 172 ?> 172 173 </p> … … 213 214 add_settings_field( 214 215 'lightpress_active_lightbox', 215 __( 'Choose Lighbox', ' easy-fancybox' ),216 __( 'Choose Lighbox', 'wp-jquery-lightbox' ), 216 217 array( __CLASS__, 'render_choose_lightbox_field' ), 217 218 'lightpress-settings', … … 240 241 </select> 241 242 <span class="description"> 242 <?php echo esc_html__( 'Additional settings for the selected lightbox will appear below.', ' easy-fancybox' ); ?>243 <?php echo esc_html__( 'Additional settings for the selected lightbox will appear below.', 'wp-jquery-lightbox' ); ?> 243 244 </span> 244 245 <?php … … 396 397 */ 397 398 public function enqueue_admin_assets() { 398 $screen = get_current_screen(); 399 $should_load_js = 400 'dashboard' === $screen->id || 401 self::$settings_screen_id === $screen->id || 402 self::$pro_screen_id === $screen->id; 403 404 if ( $should_load_js ) { 405 $css_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.css'; 406 wp_register_style( 'lightpress-admin-css', $css_file, false, LIGHTPRESS_VERSION ); 399 $screen = get_current_screen(); 400 $is_lightpress_settings = self::$settings_screen_id === $screen->id; 401 $is_pro_landing = self::$pro_screen_id === $screen->id; 402 $is_dashboard = 'dashboard' === $screen->id; 403 $freemius_js = 'https://checkout.freemius.com/checkout.min.js'; 404 $purchase_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-purchase.js'; 405 $settings_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-settings.js'; 406 $notice_js = LIGHTPRESS_PLUGIN_URL . 'admin/admin-notice.js'; 407 $css_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.css'; 408 $version = defined( 'WP_DEBUG' ) ? time() : EASY_FANCYBOX_PRO_VERSION; 409 410 if ( $is_pro_landing ) { 411 wp_register_script( 'lightpress-freemius-js', $freemius_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 412 wp_register_script( 'lightpress-purchase-js', $purchase_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 413 wp_enqueue_script( 'lightpress-freemius-js' ); 414 wp_enqueue_script( 'lightpress-purchase-js' ); 415 } 416 417 if ( $is_lightpress_settings ) { 418 wp_register_script( 'lightpress-settings-js', $settings_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 419 wp_enqueue_script( 'lightpress-settings-js' ); 420 } 421 422 if ( $is_lightpress_settings || $is_dashboard ) { 423 wp_register_script( 'lightpress-notice-js', $notice_js, array( 'jquery', 'wp-dom-ready' ), $version, true ); 424 wp_enqueue_script( 'lightpress-notice-js' ); 425 } 426 427 if ( $is_lightpress_settings || $is_pro_landing || $is_dashboard ) { 428 wp_register_style( 'lightpress-admin-css', $css_file, false, $version ); 407 429 wp_enqueue_style( 'lightpress-admin-css' ); 408 409 $js_file = LIGHTPRESS_PLUGIN_URL . 'admin/admin.js'; 410 wp_register_script( 'lightpress-admin-js', $js_file, array( 'jquery', 'wp-dom-ready' ), LIGHTPRESS_VERSION, true ); 411 wp_enqueue_script( 'lightpress-admin-js' ); 412 } 413 414 // Localize var to admin JS. 430 } 431 415 432 wp_localize_script( 416 'lightpress- admin-js',417 ' lightpress',433 'lightpress-settings-js', 434 'settings', 418 435 array( 419 'pro AdminUrl' => admin_url( 'admin.php?page=lightpress-pro' ),436 'proLandingUrl' => admin_url( 'admin.php?page=lightpress-pro' ), 420 437 ) 421 438 ); … … 439 456 update_option( 'jqlb_date', $now_as_string ); 440 457 } 458 459 /** 460 * Determine if the review request should be shown. 461 * 462 * To summarize, this will only show: 463 * if is options screen and 464 * if has not already been rated and 465 * if user is selected for metered rollout and 466 * if user has plugin more than 60 days and 467 * if use has not interacted with reviews within 90 days. 468 * 469 * @access public 470 * 471 * @return bool Returns true if the review request should be shown, false otherwise. 472 */ 473 public function should_show_review_request() { 474 // Don't show if not on options screen or dashboard, or if already rated. 475 $screen = get_current_screen(); 476 $is_dashboard_or_plugin_options = 'dashboard' === $screen->id || self::$settings_screen_id === $screen->id; 477 $already_rated = get_option( 'lightpress_plugin_rated' ) && get_option( 'lightpress_plugin_rated' ) === 'true'; 478 479 if ( ! $is_dashboard_or_plugin_options || $already_rated ) { 480 return false; 481 } 482 483 // Limit review notices to 10% of users initially. 484 $user_review_number = get_option( 'lightpress_user_review_number' ); 485 if ( ! $user_review_number ) { 486 $user_review_number = rand( 1, 10 ); // phpcs:ignore 487 update_option( 'lightpress_user_review_number', $user_review_number ); 488 } 489 $selected = '1' === $user_review_number || '2' === $user_review_number || '3' === $user_review_number || '4' === $user_review_number; 490 if ( ! $selected ) { 491 return false; 492 } 493 494 // Only show if user has been using plugin for more than 60 days. 495 $current_date = new DateTimeImmutable( gmdate( 'Y-m-d' ) ); 496 $plugin_time_stamp = get_option( 'jqlb_date' ); 497 $activation_date = $plugin_time_stamp 498 ? new DateTimeImmutable( $plugin_time_stamp ) 499 : $current_date; 500 $days_using_plugin = $activation_date->diff( $current_date )->days; 501 if ( $days_using_plugin < 60 ) { 502 return false; 503 } 504 505 // Do not show if user interacted with reviews within last 90 days. 506 $lightpress_last_review_interaction = get_option( 'lightpress_last_review_interaction' ); 507 if ( $lightpress_last_review_interaction ) { 508 $last_review_interaction_date = new DateTimeImmutable( $lightpress_last_review_interaction ); 509 $days_since_last_interaction = $last_review_interaction_date->diff( $current_date )->days; 510 if ( $days_since_last_interaction < 90 ) { 511 return false; 512 } 513 } 514 515 return true; 516 } 517 518 /** 519 * Render the review request to the user. 520 * 521 * @since 1.0.0 522 * @access public 523 * 524 * @return void 525 */ 526 public function show_review_request() { 527 if ( $this->should_show_review_request() ) { 528 ?> 529 <div class="notice notice-success is-dismissible lightpress-review-notice"> 530 <p><?php esc_html_e( 'You\'ve been using LightPress (WP JQuery Lightbox) for a long time! Awesome and thanks!', 'wp-jquery-lightbox' ); ?></p> 531 <p> 532 <?php 533 printf( 534 __( 'We work hard to maintain it - for over 10 years! Would you do us a BIG favor and give us a 5-star review on WordPress.org? Or share feedback <a %s>here</a>.', 'wp-jquery-lightbox' ), // phpcs:ignore 535 'href="https://lightpress.io/contact/" target="_blank"' 536 ); 537 ?> 538 </p> 539 540 <ul class="lightpress-review-actions" data-nonce="<?php echo esc_attr( wp_create_nonce( 'lightpress_review_action_nonce' ) ); ?>"> 541 <li style="display:inline;"><a class="button-primary" data-rate-action="do-rate" 542 href="https://wordpress.org/support/plugin/wp-jquery-lightbox/reviews/#new-post" target="_blank"><?php esc_html_e( 'Ok, you deserve it!', 'wp' ); ?></a> 543 </li> 544 <li style="display:inline;"><a class="button-secondary" data-rate-action="maybe-later" href="#"><?php esc_html_e( 'Maybe later', 'wp-jquery-lightbox' ); ?></a></li> 545 <li style="display:inline;"><a class="button-secondary" data-rate-action="done" href="#"><?php esc_html_e( 'Already did!', 'wp-jquery-lightbox' ); ?></a></li> 546 </ul> 547 </div> 548 549 <?php 550 } 551 } 552 553 /** 554 * Process Ajax request when user interacts with review requests 555 */ 556 public function process_lightpress_review_action() { 557 check_admin_referer( 'lightpress_review_action_nonce', '_n' ); 558 if ( ! current_user_can( 'manage_options' ) ) { 559 return; 560 } 561 562 $rate_action = isset( $_POST['rate_action'] ) 563 ? sanitize_text_field( wp_unslash( $_POST['rate_action'] ) ) 564 : ''; 565 $current_date = new DateTimeImmutable( gmdate( 'Y-m-d' ) ); 566 $current_date_as_string = $current_date->format( 'Y-m-d' ); 567 update_option( 'lightpress_last_review_interaction', $current_date_as_string ); 568 569 if ( 'done' === $rate_action ) { 570 update_option( 'lightpress_plugin_rated', 'true' ); 571 } 572 573 exit; 574 } 575 576 /** 577 * Disables/hides core lightbox for editor > image blocks. 578 * 579 * Helper function designed to be used by individual lightboxes 580 * to disable core lightbox if they offer that option. 581 * 582 * @param array $theme_json Theme json to filter. 583 * @return array $theme_json Filtered theme json. 584 */ 585 public static function hide_core_lightbox_in_editor( $theme_json ) { 586 $new_data = array( 587 'version' => 2, 588 'settings' => array( 589 'blocks' => array( 590 'core/image' => array( 591 'lightbox' => array( 592 'allowEditing' => false, 593 'enabled' => false, 594 ), 595 ), 596 ), 597 ), 598 ); 599 return $theme_json->update_with( $new_data ); 600 } 601 602 /** 603 * Removes filter and dequeues JS for core lightbox. 604 * 605 * Helper function designed to be used by individual lightboxes 606 * to disable core lightbox if they offer that option. 607 */ 608 public static function disable_core_lightbox_on_frontend() { 609 // These are added for the core lightbox here: 610 // https://github.com/WordPress/gutenberg/blob/8dc36f6d30cc163671bdaa33f0656fdfe91f1447/packages/block-library/src/image/index.php#L64 . 611 if ( function_exists( 'wp_dequeue_script_module' ) ) { 612 wp_dequeue_script_module( '@wordpress/block-library/image' ); 613 } 614 remove_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15 ); 615 remove_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15, 2 ); 616 } 441 617 } -
wp-jquery-lightbox/trunk/lightboxes/wp-jquery-lightbox/class-wp-jquery-lightbox.php
r3104692 r3105325 35 35 36 36 /** 37 * Is this lightbox active? 38 * 39 * @var bool 40 */ 41 public $is_active_lightbox = false; 42 43 /** 37 44 * The group of the lightbox 38 45 * … … 64 71 */ 65 72 public function __construct() { 73 $this->is_active_lightbox = LightPress::$active_lightbox === $this->lightbox_slug; 74 66 75 // Frontend. 67 if ( ! is_admin() && LightPress::$active_lightbox === $this->lightbox_slug) {76 if ( ! is_admin() && $this->is_active_lightbox ) { 68 77 add_action( 'wp_print_styles', array( $this, 'enqueue_css' ) ); 69 78 add_action( 'wp_print_scripts', array( $this, 'enqueue_js' ) ); … … 74 83 add_filter( 'comment_text', array( $this, 'lightbox_comment' ), 99 ); 75 84 } 85 if ( $this->should_disable_core_lightbox() ) { 86 add_action( 'wp_enqueue_scripts', 'LightPress::disable_core_lightbox_on_frontend', 99 ); 87 } 76 88 } 77 89 … … 79 91 if ( is_admin() ) { 80 92 add_action( 'admin_init', array( $this, 'add_lightbox_settings' ) ); 81 if ( LightPress::$active_lightbox === $this->lightbox_slug) {93 if ( $this->is_active_lightbox ) { 82 94 add_filter( 'image_send_to_editor', array( $this, 'remove_rel' ), 10, 2 ); 95 if ( $this->should_disable_core_lightbox() ) { 96 add_filter( 'wp_theme_json_data_user', 'LightPress::hide_core_lightbox_in_editor' ); 97 } 83 98 } 84 99 } … … 398 413 return $this->filter_content( $comment ); 399 414 } 415 416 /** 417 * Determines if we should disable core lightbox. 418 * 419 * @return bool True if we should disable core lightbox. 420 */ 421 public function should_disable_core_lightbox() { 422 global $wp_version; 423 $is_supported_wp_version = isset( $wp_version ) && version_compare( $wp_version, '6.5.0' ) >= 0; 424 $is_disabled = get_option( 'jqlb_disable_core_lightbox', true ); 425 426 if ( $is_supported_wp_version && $this->is_active_lightbox && $is_disabled ) { 427 return true; 428 } 429 430 return false; 431 } 400 432 } -
wp-jquery-lightbox/trunk/lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-options.php
r3104692 r3105325 229 229 ), 230 230 array( 231 'id' => 'jqlb_disable_core_lightbox', 232 'title' => __( 'Disable Core Lightbox', 'lightpress-pro' ), 233 'input' => 'checkbox', 234 'sanitize_callback' => 'wp_validate_boolean', 235 'default' => '1', 236 'section' => 'lightpress-jqlb-settings-section', 237 'description' => __( 'Disable the core lightbox when lightbox is active.', 'wp-jquery-lightbox' ), 238 ), 239 array( 231 240 'id' => 'jqlb_pinchzoom', 232 241 'title' => __( 'Enable Mobile Pinchzoom', 'wp-jquery-lightbox' ), -
wp-jquery-lightbox/trunk/readme.txt
r3104692 r3105325 4 4 Requires at least: 5.0 5 5 Tested up to: 6.5.4 6 Stable tag: 2. 1.06 Stable tag: 2.2.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 114 114 115 115 == Changelog == 116 117 = 2.2.0 (2024-06-20) = 118 * Add review requests 119 * Add option to disable core lightbox 120 * Change how plugin is instantiated 116 121 117 122 = 2.1.0 (2024-06-19) = -
wp-jquery-lightbox/trunk/wp-jquery-lightbox.php
r3104692 r3105325 4 4 * Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/ 5 5 * Description: Simple and lightweight lightbox for galleries and images. Formerly WP Jquery Lightbox. 6 * Version: 2. 1.06 * Version: 2.2.0 7 7 * Text Domain: wp-jquery-lightbox 8 8 * Author: LightPress … … 23 23 * Define constants. 24 24 */ 25 define( 'LIGHTPRESS_VERSION', '2. 1.0' );25 define( 'LIGHTPRESS_VERSION', '2.2.0' ); 26 26 define( 'LIGHTPRESS_PLUGIN_BASE', plugin_basename( __FILE__ ) ); 27 27 define( 'LIGHTPRESS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); // Includes ending slash. 28 28 define( 'LIGHTPRESS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // Includes ending slash. 29 29 30 /** 31 * Instantiate plugin. 32 * 33 * NOTE: PLUGIN DEPENDENCY 34 * We load this on plugins_loaded with priority 10. 35 * LightPress Pro depends on this plugin, and loads 36 * on plugins_loaded with priority 20. 37 */ 30 38 if ( defined( 'JQLB_LEGACY' ) && true === JQLB_LEGACY ) { 31 39 require_once LIGHTPRESS_PLUGIN_DIR . 'lightboxes/wp-jquery-lightbox/wp-jquery-lightbox-legacy.php'; 32 40 } else { 33 41 require_once LIGHTPRESS_PLUGIN_DIR . 'class-lightpress.php'; 34 new LightPress();42 add_action( 'plugins_loaded', 'LightPress::get_instance', 10 ); 35 43 }
Note: See TracChangeset
for help on using the changeset viewer.