Changeset 1661644
- Timestamp:
- 05/21/2017 12:10:27 PM (9 years ago)
- Location:
- wp-external-links/trunk
- Files:
-
- 40 edited
-
includes/admin/class-wpel-network-page.php (modified) (1 diff)
-
includes/admin/class-wpel-settings-page.php (modified) (1 diff)
-
includes/admin/network-fields/class-wpel-network-admin-fields.php (modified) (2 diffs)
-
includes/admin/network-fields/class-wpel-network-fields.php (modified) (2 diffs)
-
includes/admin/settings-fields/class-wpel-admin-fields.php (modified) (2 diffs)
-
includes/admin/settings-fields/class-wpel-exceptions-fields.php (modified) (3 diffs)
-
includes/admin/settings-fields/class-wpel-excluded-link-fields.php (modified) (1 diff)
-
includes/admin/settings-fields/class-wpel-external-link-fields.php (modified) (1 diff)
-
includes/admin/settings-fields/class-wpel-internal-link-fields.php (modified) (1 diff)
-
includes/admin/settings-fields/class-wpel-link-fields-base.php (modified) (3 diffs)
-
includes/class-wpel-front-ignore.php (modified) (1 diff)
-
includes/class-wpel-front.php (modified) (5 diffs)
-
includes/class-wpel-link.php (modified) (1 diff)
-
includes/class-wpel-plugin.php (modified) (5 diffs)
-
includes/class-wpel-register-scripts.php (modified) (1 diff)
-
includes/class-wpel-template-tags.php (modified) (2 diffs)
-
includes/class-wpel-update.php (modified) (1 diff)
-
libs/fwp/class-fwp-debug.php (modified) (2 diffs)
-
libs/wprun/class-wprun-autoloader.php (modified) (4 diffs)
-
libs/wprun/class-wprun-base.php (modified) (12 diffs)
-
public/css/wpel-admin.css (modified) (3 diffs)
-
public/js/wpel-admin.js (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
templates/network-page/help-tabs/under-construction.php (modified) (1 diff)
-
templates/network-page/main.php (modified) (1 diff)
-
templates/network-page/tab-contents/network-admin-settings.php (modified) (1 diff)
-
templates/network-page/tab-contents/network-settings.php (modified) (1 diff)
-
templates/partials/nav-tabs.php (modified) (1 diff)
-
templates/partials/tab-contents/fields-default.php (modified) (1 diff)
-
templates/partials/tab-contents/support.php (modified) (1 diff)
-
templates/requirements-notice.php (modified) (1 diff)
-
templates/settings-page/help-tabs/data-attributes.php (modified) (1 diff)
-
templates/settings-page/help-tabs/under-construction.php (modified) (1 diff)
-
templates/settings-page/main.php (modified) (2 diffs)
-
templates/settings-page/tab-contents/admin.php (modified) (1 diff)
-
templates/settings-page/tab-contents/exceptions.php (modified) (1 diff)
-
templates/settings-page/tab-contents/excluded-links.php (modified) (1 diff)
-
templates/settings-page/tab-contents/external-links.php (modified) (1 diff)
-
templates/settings-page/tab-contents/internal-links.php (modified) (1 diff)
-
wp-external-links.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-external-links/trunk/includes/admin/class-wpel-network-page.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/admin/class-wpel-settings-page.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/admin/network-fields/class-wpel-network-admin-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Network_Admin_Fields extends FWP_Settings_Section_ Fields_1x0x013 final class WPEL_Network_Admin_Fields extends FWP_Settings_Section_Base_1x0x0 14 14 { 15 15 -
wp-external-links/trunk/includes/admin/network-fields/class-wpel-network-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Network_Fields extends FWP_Settings_Section_ Fields_1x0x013 final class WPEL_Network_Fields extends FWP_Settings_Section_Base_1x0x0 14 14 { 15 15 -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-admin-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Admin_Fields extends FWP_Settings_Section_ Fields_1x0x013 final class WPEL_Admin_Fields extends FWP_Settings_Section_Base_1x0x0 14 14 { 15 15 -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-exceptions-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Exceptions_Fields extends FWP_Settings_Section_ Fields_1x0x013 final class WPEL_Exceptions_Fields extends FWP_Settings_Section_Base_1x0x0 14 14 { 15 15 … … 117 117 $this->get_html_fields()->check_with_label( 118 118 $args[ 'key' ] 119 , __( 'T hreat all links to the site\'s domain and subdomains as internal links', 'wp-external-links' )119 , __( 'Treat all links to the site\'s domain and subdomains as internal links', 'wp-external-links' ) 120 120 , '1' 121 121 , '' -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-excluded-link-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-external-link-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-internal-link-fields.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/admin/settings-fields/class-wpel-link-fields-base.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 abstract class WPEL_Link_Fields_Base extends FWP_Settings_Section_ Fields_1x0x013 abstract class WPEL_Link_Fields_Base extends FWP_Settings_Section_Base_1x0x0 14 14 { 15 15 … … 116 116 '_self' => __( 'in the same window, tab or frame', 'wp-external-links' ), 117 117 '_blank' => __( 'each in a separate new window or tab', 'wp-external-links' ), 118 '_new' => __( 'all in the same new window or tab ', 'wp-external-links' ),119 '_top' => __( 'in the topmost frame ', 'wp-external-links' ),118 '_new' => __( 'all in the same new window or tab (NOT recommended)', 'wp-external-links' ), 119 '_top' => __( 'in the topmost frame (NOT recommended)', 'wp-external-links' ), 120 120 ) 121 121 ); -
wp-external-links/trunk/includes/class-wpel-front-ignore.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/class-wpel-front.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 27 27 $this->settings_page = $settings_page; 28 28 29 // load front ignore 30 WPEL_Front_Ignore::create( $settings_page ); 31 32 // load template tags 33 WPEL_Template_Tags::create( $this ); 34 29 35 // apply page sections 30 36 if ( $this->opt( 'apply_all' ) ) { 37 // create final_output filterhook 38 FWP_Final_Output_1x0x0::create(); 39 31 40 add_action( 'final_output', $this->get_callback( 'scan' ), 10000000000 ); 32 41 } else { … … 42 51 43 52 if ( $this->opt( 'apply_widgets' ) ) { 53 // create widget_output filterhook 54 FWP_Widget_Output_1x0x0::create(); 55 44 56 array_push( $filter_hooks, 'widget_output' ); 45 57 } … … 49 61 } 50 62 } 63 } 64 65 /** 66 * Turn off output buffer for REST API calls 67 * @param type $wp_rest_server 68 */ 69 protected function action_rest_api_init() 70 { 71 ob_end_clean(); 51 72 } 52 73 … … 381 402 382 403 // is internal 383 if ( false !== strpos( $url, home_url() ) ) { 404 if ( false !== strpos( $url, home_url( '' ) ) 405 || false !== strpos( $url, home_url( '', 'https' ) ) ) { 384 406 return true; 385 407 } -
wp-external-links/trunk/includes/class-wpel-link.php
r1435123 r1661644 8 8 * @package WPEL 9 9 * @category WordPress Plugin 10 * @version 2.1. 110 * @version 2.1.2 11 11 * @author Victor Villaverde Laan 12 12 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/class-wpel-plugin.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Plugin extends WPRun_Base_1x0x013 final class WPEL_Plugin extends FWP_Plugin_Base_1x0x0 14 14 { 15 16 /**17 * @var string18 */19 private static $plugin_file = null;20 21 /**22 * @var string23 */24 private static $plugin_dir = null;25 15 26 16 /** … … 31 21 protected function init( $plugin_file, $plugin_dir ) 32 22 { 33 self::$plugin_file = $plugin_file; 34 self::$plugin_dir = untrailingslashit( $plugin_dir ); 23 parent::init( $plugin_file, $plugin_dir ); 35 24 36 WPEL_Register_Hooks::create(); 25 $this->create_components(); 26 } 27 28 /** 29 * Create components 30 */ 31 protected function create_components() 32 { 37 33 WPEL_Register_Scripts::create(); 38 34 … … 54 50 // front site 55 51 if ( ! is_admin() ) { 56 // filter hooks57 FWP_Final_Output_1x0x0::create();58 FWP_Widget_Output_1x0x0::create();59 60 // front site61 52 WPEL_Front::create( $settings_page ); 62 WPEL_Front_Ignore::create( $settings_page );63 64 WPEL_Template_Tags::create();65 53 } 66 54 … … 69 57 } 70 58 71 /**72 * Action for "plugins_loaded"73 */74 protected function action_plugins_loaded()75 {76 load_plugin_textdomain( 'wp-external-links', false, WPEL_Plugin::get_plugin_dir( '/languages' ) );77 }78 79 /**80 * @return string81 */82 public static function get_plugin_file()83 {84 return self::$plugin_file;85 }86 87 /**88 * @param string $path Optional89 * @return string90 */91 public static function get_plugin_dir( $path = '' )92 {93 return self::$plugin_dir . $path;94 }95 96 59 } 97 60 -
wp-external-links/trunk/includes/class-wpel-register-scripts.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/includes/class-wpel-template-tags.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 11 11 * @license Dual licensed under the MIT and GPLv2+ licenses 12 12 */ 13 final class WPEL_Template_Tags extends WPRun_Base_1x0x013 final class WPEL_Template_Tags extends FWP_Template_Tag_Base_1x0x0 14 14 { 15 15 16 16 /** 17 * Create template tag(s)17 * @var WPEL_Front 18 18 */ 19 protected function init() 19 private $front = null; 20 21 /** 22 * Initialize 23 * @param WPEL_Front $front 24 */ 25 protected function init( WPEL_Front $front ) 20 26 { 21 $this-> create_templatetag();27 $this->front = $front; 22 28 } 23 29 24 30 /** 25 * Create template tag 26 * @return void 31 * Template tag funtion 32 * @param string $content 33 * @return string 27 34 */ 28 p rotected function create_templatetag()35 public function wpel_filter( $content ) 29 36 { 30 if ( function_exists( 'wpel_filter' ) ) { 31 return; 32 } 33 34 /** 35 * Template tag to apply plugin settings on given content 36 * @return string 37 */ 38 function wpel_filter( $content ) { 39 // hidden dependency to WPEL_Front::scan() 40 return WPEL_Front::get_instance()->scan( $content ); 41 } 37 return $this->front->scan( $content ); 42 38 } 43 39 -
wp-external-links/trunk/includes/class-wpel-update.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/libs/fwp/class-fwp-debug.php
r1430239 r1661644 75 75 /** 76 76 * Log all hooks being applied 77 * @global type $merged_filters77 * @global array $wp_filter 78 78 */ 79 79 protected function log_hooks() 80 80 { 81 global $ merged_filters;81 global $wp_filter; 82 82 83 self::log( $merged_filters, 'WP Hooks' ); 83 $hooks = array_keys( $wp_filter ); 84 self::log( $hooks, 'WP Hooks' ); 84 85 } 85 86 86 87 /** 87 * 88 * 88 89 */ 89 90 public static function start_benchmark( $label = 'benchmark' ) … … 93 94 94 95 /** 95 * 96 * 96 97 */ 97 98 public static function end_benchmark( $label = 'benchmark' ) -
wp-external-links/trunk/libs/wprun/class-wprun-autoloader.php
r1430239 r1661644 46 46 final public function add_path( $path, $include_subfolders = false ) 47 47 { 48 if ( in_array( $path, $this->paths ) ) { 48 $absolute_path = self::get_absolute_path( $path ); 49 50 if ( ! is_dir( $absolute_path ) ) { 49 51 return; 50 52 } 51 53 52 $this->paths[] = $path; 54 if ( in_array( $absolute_path, $this->paths ) ) { 55 return; 56 } 57 58 $this->paths[] = $absolute_path; 53 59 54 60 // include subfolders 55 61 if ( true === $include_subfolders ) { 56 $entries = scandir( $ path );62 $entries = scandir( $absolute_path ); 57 63 58 64 foreach ( $entries as $entry ) { … … 61 67 } 62 68 63 $item = $ path . DIRECTORY_SEPARATOR . $entry;69 $item = $absolute_path . DIRECTORY_SEPARATOR . $entry; 64 70 65 if ( is_dir( $item ) ) {66 $this->add_path( $item, true );71 if ( ! is_dir( $item ) ) { 72 continue; 67 73 } 74 75 $this->add_path( $item, true ); 68 76 } 69 77 } 70 }78 } 71 79 72 80 /** … … 90 98 91 99 $file_name = ''; 92 $file_name .= $this->settings[ 'file_name_prefix'];93 $file_name .= str_replace( '_', $this->settings[ 'replace_dashes_with'], $pure_class_name );100 $file_name .= $this->settings[ 'file_name_prefix' ]; 101 $file_name .= str_replace( '_', $this->settings[ 'replace_dashes_with' ], $pure_class_name ); 94 102 $file_name .= '.php'; 95 103 … … 111 119 } 112 120 121 /** 122 * Convert to clean absolute path 123 * @param string $path 124 * @return string 125 */ 126 final static protected function get_absolute_path( $path ) 127 { 128 // convert to OS directory separator 129 $clean_path = str_replace( array( '/', '\\' ), DIRECTORY_SEPARATOR, $path ); 130 131 $parts = array_filter( explode( DIRECTORY_SEPARATOR, $clean_path ), 'strlen' ); 132 133 $absolutes = array(); 134 135 foreach ( $parts as $part ) { 136 if ( '.' === $part ) { 137 continue; 138 } 139 140 if ( '..' === $part ) { 141 array_pop( $absolutes ); 142 } else { 143 $absolutes[] = $part; 144 } 145 } 146 147 $absolute_path = implode( DIRECTORY_SEPARATOR, $absolutes ); 148 149 // check if given path started with directory separator 150 if ( DIRECTORY_SEPARATOR === $clean_path[ 0 ] ) { 151 $absolute_path = DIRECTORY_SEPARATOR . $absolute_path; 152 } 153 154 return $absolute_path; 155 } 156 113 157 } 114 158 -
wp-external-links/trunk/libs/wprun/class-wprun-base.php
r1435123 r1661644 3 3 * Class WPRun_Base_1x0x0 4 4 * 5 * Base class for concrete subclasses6 * All subclasses are singletons and can be instantiated with 7 * the static"create()" factory method.5 * Base abstract class can be extended for easy WP Plugin and Theme development. 6 * All subclasses are singletons and can be instantiated with the static 7 * "create()" factory method. 8 8 * 9 9 * @package WPRun … … 22 22 /** 23 23 * Page hook 24 * If page hook isset, will only apply hook methods when page hook is the current screen id 24 * Page hook can be set by subclasses, in that case filter and action methods 25 * will only be set if page hook is the current screen id 25 26 * @var string 26 27 */ … … 44 45 45 46 /** 46 * @var array 47 */ 48 protected $default_settings = array(); 49 50 /** 51 * @var array 52 */ 53 private $settings = array(); 54 55 /** 56 * Only for internal use 47 * Only for internal use (to recognize a callback call) 57 48 * @var string 58 49 */ … … 106 97 $this->arguments = $arguments; 107 98 108 if ( true === $this->autoset_hook_methods ) {109 $this->set_hook_methods();110 }111 112 99 // call init method 113 100 $method_name = 'init'; … … 122 109 } 123 110 } 111 112 // automatically set methods as callback for WP hooks 113 if ( true === $this->autoset_hook_methods ) { 114 $this->set_hook_methods(); 115 } 124 116 } 125 117 126 118 /** 127 119 * @return WPRun_Base_1x0x0 120 * @triggers E_USER_NOTICE Instance not yet created 128 121 */ 129 122 final public static function get_instance() 130 123 { 131 124 $class_name = get_called_class(); 125 126 if ( ! isset( self::$instances[ $class_name ] ) ) { 127 trigger_error( 'Instance of "'. $class_name .'" was not created.' ); 128 } 129 132 130 return self::$instances[ $class_name ]; 133 }134 135 /**136 * @param string $key137 * @return mixed138 */139 final public function get_setting( $key )140 {141 return $this->settings[ $key ];142 }143 144 /**145 * @param array $settings146 */147 final protected function set_settings( array $settings )148 {149 if ( empty( $this->settings ) ) {150 $this->settings = wp_parse_args( $settings, $this->default_settings );151 } else {152 $this->settings = wp_parse_args( $settings, $this->settings );153 }154 131 } 155 132 … … 199 176 200 177 // output template 201 $this->show_template( $template_file_path, $vars );178 self::show_template( $template_file_path, $vars ); 202 179 203 180 // get the view content … … 295 272 $action_name = self::fetch_name_containing_prefix( $this->action_prefix, $method_name ); 296 273 if ( null !== $action_name ) { 297 self::add_to_hook( $this,'action', $action_name, $method_name );274 $this->add_to_hook( 'action', $action_name, $method_name ); 298 275 continue; 299 276 } … … 301 278 $filter_name = self::fetch_name_containing_prefix( $this->filter_prefix, $method_name ); 302 279 if ( null !== $filter_name ) { 303 self::add_to_hook( $this,'filter', $filter_name, $method_name );280 $this->add_to_hook( 'filter', $filter_name, $method_name ); 304 281 continue; 305 282 } … … 308 285 309 286 /** 310 * Must be public but for internal use only311 * to support PHP 5.3 which doesn't recognize being used within class scope312 * @param string $method_name313 * @return array314 */315 final public function _get_callback( $method_name )316 {317 return $this->get_callback( $method_name );318 }319 320 /**321 * Must be public but for internal use only322 * to support PHP 5.3 which doesn't recognize being used within class scope323 * @return string324 */325 final public function _get_page_hook()326 {327 return $this->page_hook;328 }329 330 /**331 * @param WPRun_Base_1x0x0 $self332 287 * @param string $hook_type "action" or "filter" 333 288 * @param string $hook_name … … 335 290 * @triggers E_USER_NOTICE 336 291 */ 337 private static function add_to_hook( $self,$hook_type, $hook_name, $method_name )292 private function add_to_hook( $hook_type, $hook_name, $method_name ) 338 293 { 339 294 // fetch priority outof method name … … 353 308 $accepted_args = $method_reflection->getNumberOfParameters(); 354 309 355 // check if actions and filters are applied for page hook 356 $callback = function () use ( $self, $method_name ) { 357 if ( function_exists( 'get_current_screen' ) && null !== $self->_get_page_hook() ) { 358 if ( is_network_admin() ) { 359 $page_hook = $self->_get_page_hook() .'-network'; 360 } else { 361 $page_hook = $self->_get_page_hook(); 362 } 363 364 if ( get_current_screen()->id !== $page_hook ) { 365 return; 366 } 367 } 368 369 return call_user_func_array( $self->_get_callback( $method_name ), func_get_args() ); 310 // set internal wp hook action or filter callback 311 $method_callback = $this->get_callback( $method_name ); 312 $check_call_hook = $this->get_callback( 'check_call_hook' ); 313 314 $callback = function () use ( $method_callback, $check_call_hook ) { 315 $call_hook = call_user_func( $check_call_hook ); 316 317 if ( false === $call_hook ) { 318 return; 319 } 320 321 return call_user_func_array( $method_callback, func_get_args() ); 370 322 }; 371 323 … … 380 332 381 333 /** 334 * Check if an action or filter hook should be called (correct page hook) 335 * @return boolean 336 */ 337 final protected function check_call_hook() 338 { 339 if ( null === $this->page_hook ) { 340 return true; 341 } 342 343 if ( is_network_admin() ) { 344 $page_hook = $this->page_hook .'-network'; 345 } else { 346 $page_hook = $this->page_hook; 347 } 348 349 if ( get_current_screen()->id === $page_hook ) { 350 return true; 351 } 352 353 return false; 354 } 355 356 /** 382 357 * @param string $prefix 383 358 * @param string $name -
wp-external-links/trunk/public/css/wpel-admin.css
r1433846 r1661644 12 12 content: '\00a0'; 13 13 } 14 14 15 .wpel-hidden { 15 16 display: none; 16 17 } 18 19 /** 20 * Menu Icon 21 */ 17 22 18 23 a.toplevel_page_wpel-settings-page .wp-menu-image:before { … … 25 30 content: '\f14c'; 26 31 } 32 33 /** 34 * Tabs 35 */ 27 36 28 37 .wpel-settings-page .nav-tab i, … … 69 78 font-style: italic; 70 79 } 80 71 81 72 82 /** -
wp-external-links/trunk/public/js/wpel-admin.js
r1433846 r1661644 6 6 jQuery(function ($) { 7 7 'use strict'; 8 9 // add custom jQuery show/hide function 10 $.extend($.fn, { 11 wpelShow: function () { 12 var self = this; 13 this.stop({ clearQueue: true, jumpToEnd: true }); 14 this.fadeIn({ duration: 500, queue: false, complete: function () { 15 self.removeClass('wpel-hidden'); 16 }}); 17 }, 18 wpelHide: function () { 19 var self = this; 20 this.stop({ clearQueue: true, jumpToEnd: true }); 21 this.fadeOut({ duration: 500, queue: false, complete: function () { 22 self.addClass('wpel-hidden'); 23 }}); 24 } 25 }); 8 26 9 27 var $wrapper = $('.wpel-settings-page'); … … 13 31 */ 14 32 $wrapper.on('change', '.js-wpel-apply input', function () { 15 var apply _all = $(this).is(':checked');33 var applyAll = $(this).is(':checked'); 16 34 var $items = $wrapper.find('.js-wpel-apply-child'); 17 35 18 if (apply _all) {19 $items. hide();36 if (applyAll) { 37 $items.wpelHide(); 20 38 } else { 21 $items. show();39 $items.wpelShow(); 22 40 } 23 41 }); 24 42 25 43 // trigger immediatly 26 $wrapper.find('.js-wpel-apply input').change(); 27 44 $wrapper.find('.js-wpel-apply input[type="checkbox"]').change(); 28 45 29 46 /** … … 38 55 39 56 if (iconType === 'image') { 40 $itemsDepend. show();41 $itemsChild.filter('.js-icon-type-image'). show();57 $itemsDepend.wpelShow(); 58 $itemsChild.filter('.js-icon-type-image').wpelShow(); 42 59 } else if (iconType === 'dashicon') { 43 $itemsDepend. show();44 $itemsChild.filter('.js-icon-type-dashicon'). show();60 $itemsDepend.wpelShow(); 61 $itemsChild.filter('.js-icon-type-dashicon').wpelShow(); 45 62 } else if (iconType === 'fontawesome') { 46 $itemsDepend. show();47 $itemsChild.filter('.js-icon-type-fontawesome'). show();63 $itemsDepend.wpelShow(); 64 $itemsChild.filter('.js-icon-type-fontawesome').wpelShow(); 48 65 } else { 49 $itemsDepend. hide();66 $itemsDepend.wpelHide(); 50 67 } 51 68 }); 52 69 53 $wrapper.on('change', '.js-apply-settings input ', function () {70 $wrapper.on('change', '.js-apply-settings input[type="checkbox"]', function () { 54 71 var $items = $wrapper.find('.form-table tr').not('.js-apply-settings'); 55 72 56 73 if ($(this).prop('checked')) { 57 $items. show();74 $items.wpelShow(); 58 75 $wrapper.find('.js-icon-type select').change(); 59 76 } else { 60 $items. hide();77 $items.wpelHide(); 61 78 } 62 79 }); 63 80 64 81 // trigger immediatly 65 $wrapper.find('.js-apply-settings input ').change();82 $wrapper.find('.js-apply-settings input[type="checkbox"]').change(); 66 83 67 84 68 85 /** 69 86 * Support 87 * Copy to clipboard 70 88 */ 71 89 $wrapper.on('click', '.js-wpel-copy', function (e) { … … 103 121 }); 104 122 105 123 // show current tab 124 $wrapper.find('form').wpelShow(); 125 // for network pages 126 $('.wpel-network-page').find('form').wpelShow(); 127 106 128 }); -
wp-external-links/trunk/readme.txt
r1618209 r1661644 3 3 Tags: links, new window, new tab, external links, nofollow, follow, seo, noopener, noreferrer, internal links, link icon, link target, _blank, wpmu 4 4 Requires at least: 4.2.0 5 Tested up to: 4.7. 36 Stable tag: 2.1. 15 Tested up to: 4.7.5 6 Stable tag: 2.1.2 7 7 8 8 Open external links in a new tab / window, add "nofollow", "noopener" and font icons, SEO and more. Also for internal links. … … 155 155 });` 156 156 157 = How to open f.e. PDF files in a new window? = 158 159 Use some JavaScript code for opening PDF files in a new window: 160 161 `jQuery(function ($) { 162 $('a[href$=".pdf"]').prop('target', '_blank'); 163 });` 164 165 = How to set another icon for secure sites (using https)? = 166 167 Use some CSS style to change the icon for secure sites using https: 168 169 `a[href^="https"] .wpel-icon:before { 170 content: "\f023" !important; 171 }` 172 173 The code `\f023` refers to a dashicon or font awesome icon. 174 157 175 = I am a plugin developer and my plugin conflicts with WPEL. How can I solve the problem? = 158 176 … … 239 257 240 258 == Changelog == 259 260 = 2.1.2 = 261 * Fixed bug checking internal links with https 262 * Fixed bug with REST API 263 * Fixed conflict Widget CSS Classes plugin (partially fixed) 241 264 242 265 = 2.1.1 = -
wp-external-links/trunk/templates/network-page/help-tabs/under-construction.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/network-page/main.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/network-page/tab-contents/network-admin-settings.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/network-page/tab-contents/network-settings.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/partials/nav-tabs.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/partials/tab-contents/fields-default.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/partials/tab-contents/support.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/requirements-notice.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/help-tabs/data-attributes.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/help-tabs/under-construction.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/main.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com … … 31 31 ?> 32 32 33 <form method="post" action="options.php" >33 <form method="post" action="options.php" class="wpel-hidden"> 34 34 <?php 35 35 $content_tab_template = __DIR__ .'/tab-contents/'. $vars[ 'current_tab' ] .'.php'; -
wp-external-links/trunk/templates/settings-page/tab-contents/admin.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/tab-contents/exceptions.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/tab-contents/excluded-links.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/tab-contents/external-links.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/templates/settings-page/tab-contents/internal-links.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link http://www.finewebdev.com -
wp-external-links/trunk/wp-external-links.php
r1435123 r1661644 5 5 * @package WPEL 6 6 * @category WordPress Plugin 7 * @version 2.1. 17 * @version 2.1.2 8 8 * @author Victor Villaverde Laan 9 9 * @link https://wordpress.org/plugins/wp-external-links/ … … 13 13 * @wordpress-plugin 14 14 * Plugin Name: WP External Links 15 * Version: 2.1. 115 * Version: 2.1.2 16 16 * Plugin URI: https://wordpress.org/plugins/wp-external-links/ 17 17 * Description: Open external links in a new tab or window, adding "nofollow" and "noopener", set font icon, SEO friendly options and more. … … 23 23 */ 24 24 if ( ! function_exists( 'wpel_init' ) ): 25 25 26 function wpel_init() 26 27 { … … 30 31 } 31 32 33 $plugin_file = defined( 'TEST_WPEL_PLUGIN_FILE' ) ? TEST_WPEL_PLUGIN_FILE : __FILE__; 34 $plugin_dir = dirname( __FILE__ ); 35 32 36 // check requirements 33 37 $wp_version = get_bloginfo( 'version' ); 34 38 $php_version = phpversion(); 35 39 36 if ( version_compare( $wp_version, ' 3.6', '<' ) || version_compare( $php_version, '5.3', '<' ) ) {40 if ( version_compare( $wp_version, '4.2', '<' ) || version_compare( $php_version, '5.3', '<' ) ) { 37 41 if ( ! function_exists( 'wpel_requirements_notice' ) ) { 38 42 function wpel_requirements_notice() 39 43 { 40 // php 5.2 doesn't yet support __DIR__41 44 include dirname( __FILE__ ) .'/templates/requirements-notice.php'; 42 45 } … … 51 54 * Autoloader 52 55 */ 53 require_once __DIR__ . '/libs/wprun/class-wprun-autoloader.php'; 56 if ( ! class_exists( 'WPRun_Autoloader_1x0x0' ) ) { 57 require_once $plugin_dir . '/libs/wprun/class-wprun-autoloader.php'; 58 } 54 59 55 60 $autoloader = new WPRun_Autoloader_1x0x0(); 56 $autoloader->add_path( __DIR__. '/libs/', true );57 $autoloader->add_path( __DIR__. '/includes/', true );61 $autoloader->add_path( $plugin_dir . '/libs/', true ); 62 $autoloader->add_path( $plugin_dir . '/includes/', true ); 58 63 59 64 /** … … 67 72 68 73 /** 74 * Register Hooks 75 */ 76 global $wpdb; 77 WPEL_Activation::create( $plugin_file, $wpdb ); 78 WPEL_Uninstall::create( $plugin_file, $wpdb ); 79 80 /** 69 81 * Set plugin vars 70 82 */ 71 WPEL_Plugin::create( 72 defined( 'TEST_WPEL_PLUGIN_FILE' ) ? TEST_WPEL_PLUGIN_FILE : __FILE__ 73 , __DIR__ 74 ); 83 WPEL_Plugin::create( $plugin_file, $plugin_dir ); 84 75 85 } 76 86 77 87 wpel_init(); 88 78 89 endif; 79 90
Note: See TracChangeset
for help on using the changeset viewer.