Changeset 3415522
- Timestamp:
- 12/09/2025 02:33:11 PM (4 months ago)
- Location:
- remove-powered-by-wp
- Files:
-
- 3 edited
- 6 copied
-
tags/1.6.2 (copied) (copied from remove-powered-by-wp/trunk)
-
tags/1.6.2/includes (copied) (copied from remove-powered-by-wp/trunk/includes)
-
tags/1.6.2/includes/class-rpbw-common.php (copied) (copied from remove-powered-by-wp/trunk/includes/class-rpbw-common.php) (29 diffs)
-
tags/1.6.2/includes/customize-controls.js (copied) (copied from remove-powered-by-wp/trunk/includes/customize-controls.js)
-
tags/1.6.2/readme.txt (copied) (copied from remove-powered-by-wp/trunk/readme.txt) (3 diffs)
-
tags/1.6.2/remove-powered-by-wp.php (copied) (copied from remove-powered-by-wp/trunk/remove-powered-by-wp.php) (6 diffs)
-
trunk/includes/class-rpbw-common.php (modified) (29 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/remove-powered-by-wp.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
remove-powered-by-wp/tags/1.6.2/includes/class-rpbw-common.php
r2986672 r3415522 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'remove-powered-by-wp'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'remove-powered-by-wp' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'remove-powered-by-wp') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'remove-powered-by-wp') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'remove-powered-by-wp' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'remove-powered-by-wp'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css;240 echo wp_kses($generated_css, 'strip'); 237 241 238 242 } elseif ($mod) { 239 243 240 244 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css;245 echo wp_kses($generated_css, 'strip'); 242 246 243 247 } … … 249 253 if (self::$plugin_premium_class) { 250 254 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 255 if (isset($_SERVER['HTTP_HOST'])) { 256 257 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'remove-powered-by-wp' . '-upgrade/'); 258 259 } else { 260 261 return 'https://webd.uk/product/' . 'remove-powered-by-wp' . '-upgrade/'; 262 263 } 253 264 254 265 } else { … … 276 287 $settings_links = array(); 277 288 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';289 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'remove-powered-by-wp')) . '">' . __('Settings', 'remove-powered-by-wp') . '</a>'; 279 290 280 291 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 295 if (self::$plugin_upgrade) { 285 296 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 297 /* translators: name of the plugin */ 298 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'remove-powered-by-wp') . '</a>'; 287 299 288 300 } else { 289 301 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 302 /* translators: name of the plugin */ 303 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'remove-powered-by-wp'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'remove-powered-by-wp') . '</a>'; 291 304 292 305 } … … 294 307 } else { 295 308 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 309 /* translators: name of the plugin */ 310 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name) : sprintf(__('Contribute to %s', 'remove-powered-by-wp'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'remove-powered-by-wp') : __('Support Us', 'remove-powered-by-wp')) . '</a>'; 297 311 298 312 } … … 300 314 if ($premium) { 301 315 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 316 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'remove-powered-by-wp')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'remove-powered-by-wp') . '</a>'; 317 318 } elseif (self::$plugin_trial && !is_plugin_active('remove-powered-by-wp' . '-premium/' . 'remove-powered-by-wp' . '-premium.php')) { 319 320 /* translators: name of the plugin */ 321 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'remove-powered-by-wp') . '</a>'; 307 322 308 323 } … … 310 325 } elseif ($premium) { 311 326 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';327 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'remove-powered-by-wp') . '</strong>'; 313 328 314 329 } … … 320 335 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 336 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 337 if ($plugin_file === 'remove-powered-by-wp' . '/' . 'remove-powered-by-wp' . '.php') { 338 339 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'remove-powered-by-wp') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'remove-powered-by-wp') . '</a>'; 340 /* translators: name of the plugin */ 341 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'remove-powered-by-wp' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'remove-powered-by-wp'), self::$plugin_name)) . '">' . __('Review plugin', 'remove-powered-by-wp') . '</a>'; 326 342 327 343 } … … 357 373 ?> 358 374 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 376 377 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 378 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'remove-powered-by-wp'); ?></p> 379 380 <p><a href="<?php 381 /* translators: name of the plugin */ 382 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a></p> 365 383 366 384 </div> 367 385 368 386 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {387 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 388 jQuery.ajax({ 371 389 url: ajaxurl, 372 390 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'391 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 392 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 393 } 376 394 }); … … 384 402 ?> 385 403 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 404 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 405 406 <p><strong><?php 407 /* translators: name of the plugin */ 408 printf(esc_html(__('Thank you for using %s plugin', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></strong><br /> 389 409 <?php 390 410 391 411 if (self::$plugin_trial == true) { 392 412 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);413 echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'remove-powered-by-wp')); 394 414 395 415 } else { 396 416 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 417 /* translators: name of the plugin */ 418 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'remove-powered-by-wp'), self::$plugin_name)); 398 419 399 420 } … … 407 428 ?> 408 429 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 430 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php 431 /* translators: name of the plugin */ 432 echo esc_attr(sprintf(__('Try %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Trial %s Premium for 7 days', 'remove-powered-by-wp'), self::$plugin_name)); ?></a> 410 433 411 434 <?php … … 414 437 415 438 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 439 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 440 /* translators: name of the plugin */ 441 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Upgrade now to %s Premium', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a></p> 417 442 418 443 </div> 419 444 420 445 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {446 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 447 jQuery.ajax({ 423 448 url: ajaxurl, 424 449 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'450 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 451 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 452 } 428 453 }); … … 434 459 } 435 460 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 461 } elseif ( 462 // time() > (strtotime('+1 hour', filectime(__DIR__))) && 463 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 464 !get_option(self::$plugin_prefix . '_donated') 465 ) { 466 467 ?> 468 469 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 470 <p><strong><?php 471 /* translators: name of the plugin */ 472 printf(esc_html(__('Thank you for using %s plugin', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></strong></p> 473 <?php 474 475 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 476 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 477 446 478 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 479 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'remove-powered-by-wp'); ?></p> 480 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 481 /* translators: name of the plugin */ 482 echo esc_attr(sprintf(__('Contribute to %s', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'remove-powered-by-wp')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'remove-powered-by-wp'); ?></a></p> 449 483 </div> 450 484 451 485 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()486 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 487 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'remove-powered-by-wp')); ?>)) { 488 alert(<?php echo json_encode(__('Thank you!', 'remove-powered-by-wp')); ?>); 489 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 490 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 491 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 492 }); 459 493 }); … … 461 495 url: ajaxurl, 462 496 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',497 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 498 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'499 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 500 } 467 501 }); 468 502 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');503 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 504 } 471 505 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {506 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 507 jQuery.ajax({ 474 508 url: ajaxurl, 475 509 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'510 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 511 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 512 } 479 513 }); … … 509 543 is_admin() && 510 544 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 545 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 546 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 547 ) && !( 514 548 !is_admin() && 515 549 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 550 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 551 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 552 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 553 ) 520 554 ) { … … 530 564 is_admin() && 531 565 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 566 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 567 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 568 ) || ( 535 569 !is_admin() && 536 570 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 571 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 572 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 573 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 574 )) 541 575 ) { … … 549 583 !is_admin() && 550 584 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 585 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 586 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 587 554 588 ) { 555 589 556 $child = wp_get_theme( $_GET['customize_theme']);590 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 591 558 592 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 602 is_admin() && 569 603 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 604 ( 605 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 606 ( 607 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 608 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 609 ) 610 ) 571 611 ) { 572 612 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);613 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 614 615 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 616 577 617 } else { 578 618 579 $child = wp_get_theme( $_POST['customize_theme']);619 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 620 581 621 } … … 622 662 623 663 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>664 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 665 <?php 626 666 … … 647 687 ?> 648 688 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />689 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 690 <?php 651 691 -
remove-powered-by-wp/tags/1.6.2/readme.txt
r3412273 r3415522 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.6. 18 Stable tag: 1.6.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 67 67 == Changelog == 68 68 69 = 1.6.2 = 70 * General housekeeping preparing for "Plugin Check" code review 71 69 72 = 1.6.1 = 70 73 * Added compatibility for GeneratePress theme … … 207 210 == Upgrade Notice == 208 211 209 = 1.6. 1=210 * Added compatibility for GeneratePress theme212 = 1.6.2 = 213 * General housekeeping preparing for "Plugin Check" code review -
remove-powered-by-wp/tags/1.6.2/remove-powered-by-wp.php
r3076277 r3415522 2 2 /* 3 3 * Plugin Name: Remove "Powered by WordPress" 4 * Version: 1.6. 14 * Version: 1.6.2 5 5 * Plugin URI: https://webd.uk/product/support-us/ 6 6 * Description: Removes the WordPress credit on all default WordPress themes and inserts a widget area 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: remove-powered-by-wp 10 12 */ … … 16 18 class remove_powered_by_wp_class { 17 19 18 public static $version = '1.6. 1';20 public static $version = '1.6.2'; 19 21 20 22 public static $rpbw_compatible_themes = array( … … 106 108 $wp_customize->add_section('more_theme_options', array( 107 109 'title' => __('More Theme Options', 'remove-powered-by-wp'), 110 /* translators: theme name */ 108 111 'description' => sprintf(__('Would you like even more options and features for your theme %s?', 'remove-powered-by-wp'), $key), 109 112 'priority' => 0 110 113 )); 111 114 112 rpbwCommon::add_hidden_control($wp_customize, 'install_' . $value, 'more_theme_options', __('Options for ' . $key), 113 114 sprintf(wp_kses(__('<a href="%s" class="button">Install Options for %s Plugin</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'class' => array()))), esc_url(add_query_arg(array( 115 /* translators: theme name */ 116 rpbwCommon::add_hidden_control($wp_customize, 'install_' . $value, 'more_theme_options', sprintf(__('Options for %s', 'remove-powered-by-wp'), $key), 117 118 /* translators: link to plugin installer, theme name */ 119 sprintf(wp_kses(__('<a href="%1$s" class="button">Install Options for %2$s Plugin</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'class' => array()))), esc_url(add_query_arg(array( 115 120 's' => $value . ' please our modification', 116 121 'tab' => 'search', … … 667 672 ) as $key => $value) { 668 673 669 if ( get_template() == $value) {674 if ($value === get_template()) { 670 675 671 676 echo '<p>'; 672 677 printf( 673 __('You are using %s theme so you should try %s plugin which has loads more options and features!', 'remove-powered-by-wp'), 674 '<strong>' . $key . '</strong>', 675 '<strong><a href="' . add_query_arg(array( 678 wp_kses( 679 /* translators: theme name, theme name linked to plugin installer */ 680 __('You are using %1$s theme so you should try %2$s plugin which has loads more options and features!', 'remove-powered-by-wp'), 681 array('a' => array('href' => array(), 'title' => array()), 'strong' => array()) 682 ), 683 '<strong>' . esc_html($key) . '</strong>', 684 '<strong><a href="' . esc_url(add_query_arg(array( 676 685 's' => $value . ' please our modification', 677 686 'tab' => 'search', 678 687 'type' => 'term' 679 ), admin_url('plugin-install.php')) . '" title="' . __('Options for ' . $key, 'remove-powered-by-wp') . '">' . __('Options for ' . $key, 'remove-powered-by-wp') . '</a></strong>' 688 /* translators: theme name */ 689 ), admin_url('plugin-install.php'))) . '" title="' . sprintf(esc_attr(__('Options for %s', 'remove-powered-by-wp')), esc_attr($key)) . '">' . sprintf(esc_html(__('Options for %s', 'remove-powered-by-wp')), esc_html($key)) . '</a></strong>' 680 690 ); 681 691 echo '</p>'; … … 882 892 883 893 printf( 884 __('This plugin requires one of the compatible themes to be active or live previewed in order to function. Your theme "%s" is not compatible. Please install and activate or live preview one of these themes (or a child theme thereof):', 'remove-powered-by-wp'), 885 get_template() 894 /* translators: theme slug */ 895 esc_html(__('This plugin requires one of the compatible themes to be active or live previewed in order to function. Your theme "%s" is not compatible. Please install and activate or live preview one of these themes (or a child theme thereof):', 'remove-powered-by-wp')), 896 esc_html(get_template()) 886 897 ); 887 898 … … 890 901 foreach (remove_powered_by_wp_class::$rpbw_compatible_themes as $key => $value) { 891 902 892 $theme_list[] = '<a href="' . add_query_arg('search', $value, admin_url('theme-install.php')) . '" title="' . __($key, 'remove-powered-by-wp') . '">' . __($key, 'remove-powered-by-wp') . '</a>';893 894 } 895 896 echo ' ' . implode(', ', $theme_list) . '.';903 $theme_list[] = '<a href="' . add_query_arg('search', $value, admin_url('theme-install.php')) . '" title="' . esc_attr($key) . '">' . esc_html($key) . '</a>'; 904 905 } 906 907 echo esc_html(' ' . implode(', ', $theme_list) . '.'); 897 908 898 909 ?></p> -
remove-powered-by-wp/trunk/includes/class-rpbw-common.php
r2986672 r3415522 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'remove-powered-by-wp'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'remove-powered-by-wp' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'remove-powered-by-wp') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'remove-powered-by-wp') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'remove-powered-by-wp' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'remove-powered-by-wp'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css;240 echo wp_kses($generated_css, 'strip'); 237 241 238 242 } elseif ($mod) { 239 243 240 244 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css;245 echo wp_kses($generated_css, 'strip'); 242 246 243 247 } … … 249 253 if (self::$plugin_premium_class) { 250 254 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 255 if (isset($_SERVER['HTTP_HOST'])) { 256 257 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'remove-powered-by-wp' . '-upgrade/'); 258 259 } else { 260 261 return 'https://webd.uk/product/' . 'remove-powered-by-wp' . '-upgrade/'; 262 263 } 253 264 254 265 } else { … … 276 287 $settings_links = array(); 277 288 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';289 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'remove-powered-by-wp')) . '">' . __('Settings', 'remove-powered-by-wp') . '</a>'; 279 290 280 291 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 295 if (self::$plugin_upgrade) { 285 296 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 297 /* translators: name of the plugin */ 298 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'remove-powered-by-wp') . '</a>'; 287 299 288 300 } else { 289 301 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 302 /* translators: name of the plugin */ 303 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'remove-powered-by-wp'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'remove-powered-by-wp') . '</a>'; 291 304 292 305 } … … 294 307 } else { 295 308 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 309 /* translators: name of the plugin */ 310 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name) : sprintf(__('Contribute to %s', 'remove-powered-by-wp'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'remove-powered-by-wp') : __('Support Us', 'remove-powered-by-wp')) . '</a>'; 297 311 298 312 } … … 300 314 if ($premium) { 301 315 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 316 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'remove-powered-by-wp')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'remove-powered-by-wp') . '</a>'; 317 318 } elseif (self::$plugin_trial && !is_plugin_active('remove-powered-by-wp' . '-premium/' . 'remove-powered-by-wp' . '-premium.php')) { 319 320 /* translators: name of the plugin */ 321 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'remove-powered-by-wp'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'remove-powered-by-wp') . '</a>'; 307 322 308 323 } … … 310 325 } elseif ($premium) { 311 326 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';327 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'remove-powered-by-wp') . '</strong>'; 313 328 314 329 } … … 320 335 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 336 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 337 if ($plugin_file === 'remove-powered-by-wp' . '/' . 'remove-powered-by-wp' . '.php') { 338 339 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'remove-powered-by-wp') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'remove-powered-by-wp') . '</a>'; 340 /* translators: name of the plugin */ 341 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'remove-powered-by-wp' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'remove-powered-by-wp'), self::$plugin_name)) . '">' . __('Review plugin', 'remove-powered-by-wp') . '</a>'; 326 342 327 343 } … … 357 373 ?> 358 374 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 376 377 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 378 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'remove-powered-by-wp'); ?></p> 379 380 <p><a href="<?php 381 /* translators: name of the plugin */ 382 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a></p> 365 383 366 384 </div> 367 385 368 386 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {387 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 388 jQuery.ajax({ 371 389 url: ajaxurl, 372 390 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'391 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 392 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 393 } 376 394 }); … … 384 402 ?> 385 403 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 404 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 405 406 <p><strong><?php 407 /* translators: name of the plugin */ 408 printf(esc_html(__('Thank you for using %s plugin', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></strong><br /> 389 409 <?php 390 410 391 411 if (self::$plugin_trial == true) { 392 412 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain);413 echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'remove-powered-by-wp')); 394 414 395 415 } else { 396 416 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 417 /* translators: name of the plugin */ 418 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'remove-powered-by-wp'), self::$plugin_name)); 398 419 399 420 } … … 407 428 ?> 408 429 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 430 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php 431 /* translators: name of the plugin */ 432 echo esc_attr(sprintf(__('Try %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Trial %s Premium for 7 days', 'remove-powered-by-wp'), self::$plugin_name)); ?></a> 410 433 411 434 <?php … … 414 437 415 438 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 439 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 440 /* translators: name of the plugin */ 441 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Upgrade now to %s Premium', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a></p> 417 442 418 443 </div> 419 444 420 445 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {446 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 447 jQuery.ajax({ 423 448 url: ajaxurl, 424 449 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'450 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 451 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 452 } 428 453 }); … … 434 459 } 435 460 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 461 } elseif ( 462 // time() > (strtotime('+1 hour', filectime(__DIR__))) && 463 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 464 !get_option(self::$plugin_prefix . '_donated') 465 ) { 466 467 ?> 468 469 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 470 <p><strong><?php 471 /* translators: name of the plugin */ 472 printf(esc_html(__('Thank you for using %s plugin', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></strong></p> 473 <?php 474 475 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 476 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 477 446 478 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 479 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'remove-powered-by-wp'); ?></p> 480 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 481 /* translators: name of the plugin */ 482 echo esc_attr(sprintf(__('Contribute to %s', 'remove-powered-by-wp'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Contribute to %s', 'remove-powered-by-wp')), esc_html(self::$plugin_name)); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'remove-powered-by-wp')); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', 'remove-powered-by-wp'); ?></a></p> 449 483 </div> 450 484 451 485 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()486 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 487 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'remove-powered-by-wp')); ?>)) { 488 alert(<?php echo json_encode(__('Thank you!', 'remove-powered-by-wp')); ?>); 489 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 490 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 491 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 492 }); 459 493 }); … … 461 495 url: ajaxurl, 462 496 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',497 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 498 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'499 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 500 } 467 501 }); 468 502 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');503 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 504 } 471 505 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {506 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 507 jQuery.ajax({ 474 508 url: ajaxurl, 475 509 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'510 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 511 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 512 } 479 513 }); … … 509 543 is_admin() && 510 544 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 545 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 546 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 547 ) && !( 514 548 !is_admin() && 515 549 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 550 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 551 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 552 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 553 ) 520 554 ) { … … 530 564 is_admin() && 531 565 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 566 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 567 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 568 ) || ( 535 569 !is_admin() && 536 570 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 571 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 572 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 573 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 574 )) 541 575 ) { … … 549 583 !is_admin() && 550 584 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 585 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 586 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 587 554 588 ) { 555 589 556 $child = wp_get_theme( $_GET['customize_theme']);590 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 591 558 592 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 602 is_admin() && 569 603 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 604 ( 605 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 606 ( 607 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 608 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 609 ) 610 ) 571 611 ) { 572 612 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);613 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 614 615 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 616 577 617 } else { 578 618 579 $child = wp_get_theme( $_POST['customize_theme']);619 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 620 581 621 } … … 622 662 623 663 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>664 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 665 <?php 626 666 … … 647 687 ?> 648 688 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />689 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 690 <?php 651 691 -
remove-powered-by-wp/trunk/readme.txt
r3412273 r3415522 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.6. 18 Stable tag: 1.6.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 67 67 == Changelog == 68 68 69 = 1.6.2 = 70 * General housekeeping preparing for "Plugin Check" code review 71 69 72 = 1.6.1 = 70 73 * Added compatibility for GeneratePress theme … … 207 210 == Upgrade Notice == 208 211 209 = 1.6. 1=210 * Added compatibility for GeneratePress theme212 = 1.6.2 = 213 * General housekeeping preparing for "Plugin Check" code review -
remove-powered-by-wp/trunk/remove-powered-by-wp.php
r3076277 r3415522 2 2 /* 3 3 * Plugin Name: Remove "Powered by WordPress" 4 * Version: 1.6. 14 * Version: 1.6.2 5 5 * Plugin URI: https://webd.uk/product/support-us/ 6 6 * Description: Removes the WordPress credit on all default WordPress themes and inserts a widget area 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: remove-powered-by-wp 10 12 */ … … 16 18 class remove_powered_by_wp_class { 17 19 18 public static $version = '1.6. 1';20 public static $version = '1.6.2'; 19 21 20 22 public static $rpbw_compatible_themes = array( … … 106 108 $wp_customize->add_section('more_theme_options', array( 107 109 'title' => __('More Theme Options', 'remove-powered-by-wp'), 110 /* translators: theme name */ 108 111 'description' => sprintf(__('Would you like even more options and features for your theme %s?', 'remove-powered-by-wp'), $key), 109 112 'priority' => 0 110 113 )); 111 114 112 rpbwCommon::add_hidden_control($wp_customize, 'install_' . $value, 'more_theme_options', __('Options for ' . $key), 113 114 sprintf(wp_kses(__('<a href="%s" class="button">Install Options for %s Plugin</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'class' => array()))), esc_url(add_query_arg(array( 115 /* translators: theme name */ 116 rpbwCommon::add_hidden_control($wp_customize, 'install_' . $value, 'more_theme_options', sprintf(__('Options for %s', 'remove-powered-by-wp'), $key), 117 118 /* translators: link to plugin installer, theme name */ 119 sprintf(wp_kses(__('<a href="%1$s" class="button">Install Options for %2$s Plugin</a>', 'remove-powered-by-wp'), array('a' => array('href' => array(), 'class' => array()))), esc_url(add_query_arg(array( 115 120 's' => $value . ' please our modification', 116 121 'tab' => 'search', … … 667 672 ) as $key => $value) { 668 673 669 if ( get_template() == $value) {674 if ($value === get_template()) { 670 675 671 676 echo '<p>'; 672 677 printf( 673 __('You are using %s theme so you should try %s plugin which has loads more options and features!', 'remove-powered-by-wp'), 674 '<strong>' . $key . '</strong>', 675 '<strong><a href="' . add_query_arg(array( 678 wp_kses( 679 /* translators: theme name, theme name linked to plugin installer */ 680 __('You are using %1$s theme so you should try %2$s plugin which has loads more options and features!', 'remove-powered-by-wp'), 681 array('a' => array('href' => array(), 'title' => array()), 'strong' => array()) 682 ), 683 '<strong>' . esc_html($key) . '</strong>', 684 '<strong><a href="' . esc_url(add_query_arg(array( 676 685 's' => $value . ' please our modification', 677 686 'tab' => 'search', 678 687 'type' => 'term' 679 ), admin_url('plugin-install.php')) . '" title="' . __('Options for ' . $key, 'remove-powered-by-wp') . '">' . __('Options for ' . $key, 'remove-powered-by-wp') . '</a></strong>' 688 /* translators: theme name */ 689 ), admin_url('plugin-install.php'))) . '" title="' . sprintf(esc_attr(__('Options for %s', 'remove-powered-by-wp')), esc_attr($key)) . '">' . sprintf(esc_html(__('Options for %s', 'remove-powered-by-wp')), esc_html($key)) . '</a></strong>' 680 690 ); 681 691 echo '</p>'; … … 882 892 883 893 printf( 884 __('This plugin requires one of the compatible themes to be active or live previewed in order to function. Your theme "%s" is not compatible. Please install and activate or live preview one of these themes (or a child theme thereof):', 'remove-powered-by-wp'), 885 get_template() 894 /* translators: theme slug */ 895 esc_html(__('This plugin requires one of the compatible themes to be active or live previewed in order to function. Your theme "%s" is not compatible. Please install and activate or live preview one of these themes (or a child theme thereof):', 'remove-powered-by-wp')), 896 esc_html(get_template()) 886 897 ); 887 898 … … 890 901 foreach (remove_powered_by_wp_class::$rpbw_compatible_themes as $key => $value) { 891 902 892 $theme_list[] = '<a href="' . add_query_arg('search', $value, admin_url('theme-install.php')) . '" title="' . __($key, 'remove-powered-by-wp') . '">' . __($key, 'remove-powered-by-wp') . '</a>';893 894 } 895 896 echo ' ' . implode(', ', $theme_list) . '.';903 $theme_list[] = '<a href="' . add_query_arg('search', $value, admin_url('theme-install.php')) . '" title="' . esc_attr($key) . '">' . esc_html($key) . '</a>'; 904 905 } 906 907 echo esc_html(' ' . implode(', ', $theme_list) . '.'); 897 908 898 909 ?></p>
Note: See TracChangeset
for help on using the changeset viewer.