Changeset 1837822
- Timestamp:
- 03/11/2018 05:39:58 AM (8 years ago)
- Location:
- quick-and-easy-seo-tool
- Files:
-
- 7 edited
-
tags/1.4/README.txt (modified) (1 diff)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/class-quick-and-easy-seo-admin.php (modified) (15 diffs)
-
trunk/includes/class-quick-and-easy-seo-activator.php (modified) (1 diff)
-
trunk/includes/class-quick-and-easy-seo.php (modified) (4 diffs)
-
trunk/public/class-quick-and-easy-seo-public.php (modified) (14 diffs)
-
trunk/quick-and-easy-seo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
quick-and-easy-seo-tool/tags/1.4/README.txt
r1714648 r1837822 120 120 == Changelog == 121 121 122 = 1.4 = 123 * Added canonical tags to archive pages 124 125 122 126 == Upgrade Notice == -
quick-and-easy-seo-tool/trunk/README.txt
r1714640 r1837822 1 1 === Quick And Easy SEO TOOL === 2 Contributors: OrbitingWeb3 Tags: seo, robots meta tag, robots noindex tag, rel prev and next tag, custom meta description, custom title tags4 Requires at least: 4. 15 Tested up to: 4. 8.16 Stable tag: 1.4 2 Contributors: inorbit 3 Tags: quick and easy seo plugin, easy seo plugin, wordpress seo plugin, robots noindex tag, rel prev and next tag, woocommerce SEO plugin, custom title tags 4 Requires at least: 4.4 5 Tested up to: 4.9.4 6 Stable tag: 1.4.1 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html 9 9 10 A fully configured SEO plugin to make your blog 100% SEO friendly - blocks indexing of duplicate pages, allows custom title/meta description tags and more.10 A light weight plugin that fixes all SEO loopholes in wordpress. Woocommerce Compatible. 11 11 12 12 == Description == 13 13 14 Quick And Easy SEO makes your blog 100% SEO friendly by fixing all the known SEO related issues with the newer versions of wordpress. 15 16 The plugin comes pre-configured, so all you need to do is activate it. But if you want, you have the option to manually configure 17 the options to suit your needs. 18 19 This plugin only adds the most important functionalities that are required to make your site SEO friendly. All unnecessary stuff is omitted. 14 Quick And Easy SEO fixes all SEO loopholes and makes your blog 100% SEO friendly. Comes pre-configured, but you also have the option to customize settings. 20 15 21 16 = What does the plugin do? = 22 17 23 What the plugin does can be divided into the four parts as follows: 18 * Blocks duplicate archive pages from getting indexed by search engines. 19 * Adds 'Next' and 'Prev' tags to all archive pages & paginated single post pages (to indicate to Google that these pages are part of a sequence). 20 * Removes unwanted tags from wordpress head section (that helps increase page load speeds). 21 * Allows you to add custom title tags and meta description tags for homepage, posts, pages, media attachments, woocommerce and other post formats. 22 * Allows you to format the title tags. 23 * Adds canonical tags to all posts, pages and archives. 24 * Optimizes woocommerce product pages, shop, category and tag pages. 25 * Adds Facebook OG (Open Graph) tags that include og:image, og:title, og:url, og:descrption and og:site_name; 24 26 25 = 1.) Adds Robots meta tags = 26 27 Adds the Robots Noindex/Follow meta tag to the following pages: 28 29 30 * Adds Noindex to search and 404 pages. 31 * Adds Noindex to all date archives - daily, monthly and yearly archives. 32 * Adds Noindex to author archives. 33 * Adds Noindex to media attachment pages. 34 * Adds Noindex to tag archives from page 2 onward. 35 * Adds Noindex to category archives from page 2 onward. 36 * Adds Noindex to homepage archives from page 2 onward. 37 38 39 = 2.) Adds Next/Prev Rel tags to archive pages = 40 41 Adds the *rel='next'* and *rel='prev'* tags to all paginated archives and to single posts where pagination is present. 42 43 44 * Add rel='next' and rel='prev' tag to all archive pages (date, category, tag, author, homepage) including custom taxonomies.</li> 45 * Add rel='next' and rel='prev' tag to paginated single posts (Posts paginated using the <!--Nextpage--> tag)</li> 46 47 48 This tag tells Google that these pages are part of a paginated sequence. [Here's what Google has to say about these tags](https://support.google.com/webmasters/answer/1663744?hl=en) 49 50 = 3.) Removes unwanted tags from wordpress head section = 51 52 Wordpress by default adds a lot of tags in the head section that are unnecessary. This plugin removes some of these tags. The tags removed include the following: 53 54 55 * Next/Prev tag from single post pages 56 * Shortlink tag 57 * WLW tag 58 * WP Generator tag 59 * Regular feed and comment feed tags 60 * XMLRPC tag 61 62 63 = 4.) Adds custom title tag & meta description tag meta boxes = 64 65 Adds custom title tag and meta description tag meta boxes for all single posts, pages and custom post types like Woocommerce pages. Using these boxes, you can easily add custom title tags and meta description tags for your posts and pages. 66 67 = 5.) Adds canonical tags for archive pages = 68 69 Wordpress automatically adds canonical tag for all single post pages. Therefore, the plugin adds Canonical tags only for the archive pages. This includes the homepage archive pages. 27 Note: The plugin works with title tags added by wordpress. 70 28 71 29 For more in-depth information about the plugin, please visit: [https://orbitingweb.com/blog/quick-and-easy-seo-tool/](https://orbitingweb.com/blog/quick-and-easy-seo-tool/) … … 92 50 == Frequently Asked Questions == 93 51 94 = Does the plugin add canonical tags? = 95 96 Yes, the plugin does add canonical tags, but only to archive pages (eg: category pages). This is because, WordPress automatically adds canonical tags to all other single post pages. 52 = Can I use this along with Yoast or other SEO plugins? = 53 No, using this plugin with other SEO plugins will cause duplicate tags to be generated. 97 54 98 55 = Does the plugin fix all SEO related issues with WordPress? = … … 120 77 == Changelog == 121 78 79 = 1.4.1 = 80 * Added OG tags to single posts, pages, post formats and homepage. 81 * Option to add title separator and title formating include ability to remove site name from the title tag. 82 * Added custom meta description and title tags for homepage. 83 * Added custom title and description for media attachment pages. 84 * Added custom title tag and meta description meta box to woocommerce category and tag pages. 85 * Added custom title and meta description tag for woocommerce shop page. 86 87 122 88 == Upgrade Notice == -
quick-and-easy-seo-tool/trunk/admin/class-quick-and-easy-seo-admin.php
r1714633 r1837822 26 26 27 27 } 28 28 29 /* 30 Use this to enqueue javascript 31 public function enqueue_scripts() { 32 33 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/qeseo-plugin-admin.js', array( 'jquery' ), $this->version, false ); 34 35 }*/ 36 29 37 /* Add settings link */ 30 38 public function qeseo_plug_settings_link( $links ){ … … 75 83 register_setting( $this->plugin_name, $this->plugin_name, array( $this, 'qeseo_validate_entries' ) ); 76 84 77 /*section 1 for robots tag*/ 85 86 /*section 1 for homepage title tag*/ 87 add_settings_section( $this->plugin_name.'hometitle_section', 'Homepage Title & Meta Description Tag (optional)', array( $this, 'qeseo_hp_titlemeta_section' ), $this->plugin_name ); 88 add_settings_field( $this->plugin_name.'hp_titlemeta_tag', 'Homepage Title Tag', array( $this, 'qeseo_hp_custom_title_tag' ), $this->plugin_name, $this->plugin_name.'hometitle_section' ); 89 add_settings_field( $this->plugin_name.'hp_metades_tag', 'Homepage Meta Description', array( $this, 'qeseo_hp_metades_tag' ), $this->plugin_name, $this->plugin_name.'hometitle_section' ); 90 91 /*section 2 for title tag separator*/ 92 add_settings_section( $this->plugin_name.'titleseparator_section', 'Title Tag Formatting (optional)', array( $this, 'qeseo_titleseparator_section' ), $this->plugin_name ); 93 add_settings_field( $this->plugin_name.'titleseparator', 'Title Tag Separator', array( $this, 'qeseo_title_tag_separator' ), $this->plugin_name, $this->plugin_name.'titleseparator_section' ); 94 add_settings_field( $this->plugin_name.'remove_sitename_title', 'Remove sitename from title tag', array( $this, 'qeseo_remove_sitename' ), $this->plugin_name, $this->plugin_name.'titleseparator_section' ); 95 96 97 /*section 3 for robots tag*/ 78 98 add_settings_section( $this->plugin_name.'robots_section', 'Robots Meta Tag Settings', array( $this, 'qeseo_robots_meta_tag_form_section' ), $this->plugin_name ); 79 99 add_settings_field( $this->plugin_name.'search_robots_tag', 'Search Pages', array( $this, 'qeseo_search_meta_tag' ), $this->plugin_name, $this->plugin_name.'robots_section' ); … … 86 106 add_settings_field( $this->plugin_name.'homepage_archives_robots_tag', 'Homepage Paginated Pages', array( $this, 'qeseo_homepage_archives_meta_tag' ), $this->plugin_name, $this->plugin_name.'robots_section' ); 87 107 88 /*section 2for custom title tag meta box*/108 /*section 4 for custom title tag meta box*/ 89 109 add_settings_section( $this->plugin_name.'meta_box_section', 'Add Custom Title Tag & Meta Description Meta Box', array( $this, 'qeseo_meta_box_section_cb' ), $this->plugin_name ); 90 add_settings_field( $this->plugin_name.'title_tag_meta_box', 'Add custom title tags meta box to:', array( $this, 'qeseo_title_tag_meta_box_field' ), $this->plugin_name, $this->plugin_name.'meta_box_section' );91 add_settings_field( $this->plugin_name.'metades_meta_box', 'Add custom meta description meta box to:', array( $this, 'qeseo_metades_meta_box_field' ), $this->plugin_name, $this->plugin_name.'meta_box_section' );92 93 /*section 3to remove unwated head tags*/110 add_settings_field( $this->plugin_name.'title_tag_meta_box', 'Add custom title tags & meta description meta box to:', array( $this, 'qeseo_title_tag_meta_box_field' ), $this->plugin_name, $this->plugin_name.'meta_box_section' ); 111 #add_settings_field( $this->plugin_name.'metades_meta_box', 'Add custom meta description meta box to:', array( $this, 'qeseo_metades_meta_box_field' ), $this->plugin_name, $this->plugin_name.'meta_box_section' ); 112 113 /*section 5 to remove unwated head tags*/ 94 114 add_settings_section( $this->plugin_name.'remove_tags_section', 'Remove Unwanted Tags From Wordpress Head Section', array( $this, 'qeseo_remove_tags_section_cb' ), $this->plugin_name ); 95 115 add_settings_field( $this->plugin_name.'remove_nextprev_tag', 'Remove Next/Prev tags from post pages:', array( $this, 'qeseo_remove_next_prev_field' ), $this->plugin_name, $this->plugin_name.'remove_tags_section' ); … … 100 120 add_settings_field( $this->plugin_name.'remove_xmlrpc_tag', 'Remove XMLRPC tag:', array( $this, 'qeseo_remove_xml_rpc_field' ), $this->plugin_name, $this->plugin_name.'remove_tags_section' ); 101 121 102 /*section 4to add next and prev tags*/122 /*section 6 to add next and prev tags*/ 103 123 add_settings_section( $this->plugin_name.'add_nextprev_tag_section', 'Add Next/Prev Rel Tags to Archive Pages', array( $this, 'qeseo_prevnext_rel_tags_cb' ), $this->plugin_name ); 104 124 add_settings_field( $this->plugin_name.'add_archives_nextprev_rel_tag', 'Add Next/Prev rel tags to all archive pages:', array( $this, 'qeseo_add_nextprev_archives_field' ), $this->plugin_name, $this->plugin_name.'add_nextprev_tag_section' ); 105 125 add_settings_field( $this->plugin_name.'add_single_nextprev_rel_tag', 'Add Next/Prev rel tags to paginated single post pages:', array( $this, 'qeseo_add_nextprev_singleposts_field' ), $this->plugin_name, $this->plugin_name.'add_nextprev_tag_section' ); 106 126 107 } 108 109 /* Form section 1 callback */ 127 /*section 7 to add og tags*/ 128 add_settings_section( $this->plugin_name.'add_og_tag_section', 'Add OG (Open Graph) Tags', array( $this, 'qeseo_og_tags_cb' ), $this->plugin_name ); 129 add_settings_field( $this->plugin_name.'add_fb_og_tags', 'Add OG tags:', array( $this, 'qeseo_add_ogtags_field' ), $this->plugin_name, $this->plugin_name.'add_og_tag_section' ); 130 add_settings_field( $this->plugin_name.'add_hp_ogimg_tags', 'Homepage OG Image URL (optional):', array( $this, 'qeseo_add_hp_ogimg_field' ), $this->plugin_name, $this->plugin_name.'add_og_tag_section', array( 'class' => 'qeseo_hp_ogimg_class' ) ); 131 add_settings_field( $this->plugin_name.'add_fallback_ogimg_tags', 'Fallback OG Image URL (optional):', array( $this, 'qeseo_add_fb_ogimg_field' ), $this->plugin_name, $this->plugin_name.'add_og_tag_section', array( 'class' => 'qeseo_fb_ogimg_class' ) ); 132 add_settings_field( $this->plugin_name.'add_fb_appid_tag', 'Facebook App ID (optional):', array( $this, 'qeseo_add_fb_appid_field' ), $this->plugin_name, $this->plugin_name.'add_og_tag_section', array( 'class' => 'qeseo_fb_appid_class' ) ); 133 add_settings_field( $this->plugin_name.'add_fb_admin_tag', 'Facebook Admin ID (optional):', array( $this, 'qeseo_add_fb_admin_field' ), $this->plugin_name, $this->plugin_name.'add_og_tag_section', array( 'class' => 'qeseo_fb_admin_class' ) ); 134 135 136 } 137 138 /* Form section 1 callback */ 139 public function qeseo_hp_titlemeta_section(){ 140 echo 'If you leave this empty, default title tags will be used for homepage.'; 141 } 142 143 /* Form section 2 callback */ 110 144 public function qeseo_robots_meta_tag_form_section(){ 111 145 echo 'Add robots meta tag to disallow indexing/crawling of archive pages and other low value pages'; 112 146 } 113 114 /* Form section 2 callback */ 147 148 /* Form section 3 callback */ 149 public function qeseo_titleseparator_section(){ 150 echo 'Settings for title tag.'; 151 } 152 153 /* Form section 4 callback */ 115 154 public function qeseo_meta_box_section_cb(){ 116 155 echo 'Display title tag and meta description meta box for all posts, pages and custom post types'; 117 156 } 118 157 119 /* Form section 3callback */158 /* Form section 5 callback */ 120 159 public function qeseo_remove_tags_section_cb(){ 121 160 echo 'Remove unwanted meta tags from WP head section'; 122 161 } 123 162 124 /* Form section 4callback */163 /* Form section 6 callback */ 125 164 public function qeseo_prevnext_rel_tags_cb(){ 126 165 echo 'Add Next/Prev rel tags to all archive pages and to single post pages that have pagination.'; 127 166 } 128 167 168 /* Form section 7 callback */ 169 public function qeseo_og_tags_cb(){ 170 echo 'Add og tags to single posts, pages, post formats and homepage.'; 171 } 172 173 /* Form HP title tag field callback */ 174 public function qeseo_hp_custom_title_tag(){ 175 $qeseo_custom_hp_title = ''; 176 if( isset( $this->qeseo_options['qeseo_hp_title'] ) || ! empty ( $this->qeseo_options['qeseo_hp_title'] )){ 177 $qeseo_custom_hp_title = trim(stripslashes(esc_html($this->qeseo_options['qeseo_hp_title']))); 178 } 179 180 ?> 181 <input type="text" name="qeseo_hp_title" id="qeseo_hp_title" value="<?php echo $qeseo_custom_hp_title ? $qeseo_custom_hp_title : ''; ?>"> 182 <?php 183 } 184 185 186 /* Form field HP meta description callback */ 187 public function qeseo_hp_metades_tag(){ 188 $qeseo_hp_metades = ''; 189 if( isset( $this->qeseo_options['qeseo_hp_metades'] ) && !empty( $this->qeseo_options['qeseo_hp_metades'] ) ){ 190 $qeseo_hp_metades = trim(stripslashes(esc_html($this->qeseo_options['qeseo_hp_metades']))); 191 } 192 193 ?> 194 <textarea name="qeseo_hp_metades" id="qeseo_hp_metades" rows="2" cols="55" > <?php echo $qeseo_hp_metades ? $qeseo_hp_metades : ''; ?> </textarea> 195 <?php 196 } 197 198 /* Form field title tag separator callback */ 199 200 public function qeseo_title_tag_separator(){ 201 $qeseo_separator_option = $this->qeseo_options['qeseo_title_separator']; 202 ?> 203 <select name="qeseo_title_separator" id="qeseo_title_separator"> 204 <option value="-" <?php selected( $qeseo_separator_option,'-' ) ?> >-</option> 205 <option value="bdash" <?php selected( $qeseo_separator_option,'bdash' ) ?> >—</option> 206 <option value="|" <?php selected( $qeseo_separator_option,'|' ) ?> >|</option> 207 <option value="*" <?php selected( $qeseo_separator_option,'*' ) ?> >*</option> 208 <option value="~" <?php selected( $qeseo_separator_option,'~' ) ?> >~</option> 209 <option value=":" <?php selected( $qeseo_separator_option,':' ) ?> >:</option> 210 <option value="::" <?php selected( $qeseo_separator_option,'::' ) ?> >::</option> 211 <option value=">" <?php selected( $qeseo_separator_option,'>' ) ?> >></option> 212 <option value="." <?php selected( $qeseo_separator_option,'.' ) ?> >.</option> 213 <option value="darrow" <?php selected( $qeseo_separator_option,'darrow' ) ?> >»</option> 214 <option value="bdot" <?php selected( $qeseo_separator_option,'bdot' ) ?> >•</option> 215 <option value="diamond" <?php selected( $qeseo_separator_option,'diamond' ) ?> >♦</option> 216 <option value="hearts" <?php selected( $qeseo_separator_option,'hearts' ) ?> >♥</option> 217 </select> 218 <?php 219 } 129 220 130 221 /* Form field 1 callback */ … … 246 337 } 247 338 248 /* Form field 10 callback */339 /* Form field 10 callback 249 340 public function qeseo_metades_meta_box_field(){ 250 341 $qeseo_metades_add_option = $this->qeseo_options['qeseo_custom_metades_field']; … … 256 347 </select> 257 348 <?php 258 } 349 } */ 259 350 260 351 /* Form field 11 callback */ … … 310 401 $qeseo_nextprev_archives_option = $this->qeseo_options['qeseo_add_nextprev_archives_field']; 311 402 ?> 312 <select name="qeseo_add_nextprev_archives_field" id="ow_field_17"> 313 <option value="yes" <?php selected( $qeseo_nextprev_archives_option,'yes' ) ?> >Yes</option> 314 <option value="no" <?php selected( $qeseo_nextprev_archives_option,'no' ) ?>>No</option> 315 </select> 403 <input type="checkbox" name="qeseo_add_nextprev_archives_field" id="qeseo_add_nextprev_archives_field" <?php checked( $qeseo_nextprev_archives_option, 1 ) ?> > 404 316 405 <?php 317 406 } … … 321 410 $qeseo_nextprev_singlepages_option = $this->qeseo_options['qeseo_add_nextprev_singlepages_field']; 322 411 ?> 323 <select name="qeseo_add_nextprev_singlepages_field" id="ow_field_17"> 324 <option value="yes" <?php selected( $qeseo_nextprev_singlepages_option,'yes' ) ?> >Yes</option> 325 <option value="no" <?php selected( $qeseo_nextprev_singlepages_option,'no' ) ?>>No</option> 326 </select> 327 <?php 328 } 412 <input type="checkbox" name="qeseo_add_nextprev_singlepages_field" id="qeseo_add_nextprev_singlepages_field" <?php checked( $qeseo_nextprev_singlepages_option, 1 ) ?> > 413 <?php 414 } 415 416 /* Form field 19 callback */ 417 public function qeseo_add_ogtags_field(){ 418 $qeseo_ogtags_option = $this->qeseo_options['qeseo_add_ogtag_field']; 419 ?> 420 <input type="checkbox" name="qeseo_add_ogtag_field" id="qeseo_add_ogtag_field" <?php checked( $qeseo_ogtags_option, 1 ) ?> > 421 <?php 422 } 423 424 /* Form field 20 callback */ 425 public function qeseo_add_hp_ogimg_field(){ 426 $qeseo_hp_ogimg_option = ''; 427 if( isset( $this->qeseo_options['qeseo_hp_ogimg_option'] ) && !empty( $this->qeseo_options['qeseo_hp_ogimg_option'] ) ){ 428 $qeseo_hp_ogimg_option = trim(esc_url($this->qeseo_options['qeseo_hp_ogimg_option'])); 429 } 430 ?> 431 <input type="url" name="qeseo_hp_ogimg" id="qeseo_hp_ogimg" value="<?php echo $qeseo_hp_ogimg_option ? $qeseo_hp_ogimg_option : ''; ?>"> 432 <?php 433 } 434 435 /* Form field 21 callback */ 436 public function qeseo_add_fb_ogimg_field(){ 437 $qeseo_fb_ogimg_option = ''; 438 if( isset( $this->qeseo_options['qeseo_fb_ogimg_option'] ) && !empty( $this->qeseo_options['qeseo_fb_ogimg_option'] ) ){ 439 $qeseo_fb_ogimg_option = trim(esc_url($this->qeseo_options['qeseo_fb_ogimg_option'])); 440 } 441 ?> 442 <input type="url" name="qeseo_fb_ogimg" id="qeseo_fb_ogimg" value="<?php echo $qeseo_fb_ogimg_option ? $qeseo_fb_ogimg_option : ''; ?>"> 443 <p class="description"><?php _e('used in case a featured image is missing', 'text_domain'); ?></p> 444 <?php 445 } 446 447 /* Form field 22 callback */ 448 public function qeseo_add_fb_appid_field(){ 449 $qeseo_fb_appid_option = ''; 450 if( isset( $this->qeseo_options['qeseo_fb_appid_option'] ) && !empty( $this->qeseo_options['qeseo_fb_appid_option'] ) ){ 451 $qeseo_fb_appid_option = trim(intval($this->qeseo_options['qeseo_fb_appid_option'])); 452 } 453 ?> 454 <input type="number" name="qeseo_fb_appid" id="qeseo_fb_appid" value="<?php echo $qeseo_fb_appid_option ? $qeseo_fb_appid_option : ''; ?>"> 455 <?php 456 } 457 458 /* Form field 23 callback */ 459 public function qeseo_add_fb_admin_field(){ 460 $qeseo_fb_admin_option = ''; 461 if( isset( $this->qeseo_options['qeseo_fb_admin_option'] ) && !empty( $this->qeseo_options['qeseo_fb_admin_option'] ) ){ 462 $qeseo_fb_admin_option = trim(intval($this->qeseo_options['qeseo_fb_admin_option'])); 463 } 464 ?> 465 <input type="number" name="qeseo_fb_admin" id="qeseo_fb_admin" value="<?php echo $qeseo_fb_admin_option ? $qeseo_fb_admin_option : ''; ?>"> 466 <?php 467 } 468 469 /* Form field 24 callback */ 470 public function qeseo_remove_sitename(){ 471 $qeseo_remove_sitename_option = ''; 472 if( isset($this->qeseo_options['qeseo_remove_sitename_option']) && !empty($this->qeseo_options['qeseo_remove_sitename_option']) ){ 473 $qeseo_remove_sitename_option = $this->qeseo_options['qeseo_remove_sitename_option']; 474 } 475 ?> 476 <input type="checkbox" name="qeseo_remove_sitename_title" id="qeseo_remove_sitename_title" <?php checked( $qeseo_remove_sitename_option, 1 ) ?> > 477 <?php 478 } 479 480 481 329 482 330 483 /* Validate form input data */ … … 334 487 $valid = array(); 335 488 336 $valid['qeseo_search'] = (isset( $_POST[ "qeseo_search" ] ) && !empty( $_POST[ "qeseo_search" ] )) ? $_POST[ "qeseo_search" ] : ''; 337 338 $valid['qeseo_404'] = (isset( $_POST[ "qeseo_404" ] ) && !empty( $_POST[ "qeseo_404" ] )) ? $_POST[ "qeseo_404" ] : ''; 339 340 $valid['qeseo_attachments'] = (isset( $_POST[ "qeseo_attachments" ] ) && !empty( $_POST[ "qeseo_attachments" ] )) ? $_POST[ "qeseo_attachments" ] : ''; 341 342 $valid['qeseo_date'] = (isset( $_POST[ "qeseo_date" ] ) && !empty( $_POST[ "qeseo_date" ] )) ? $_POST[ "qeseo_date" ] : ''; 343 344 $valid['qeseo_author'] = (isset( $_POST[ "qeseo_author" ] ) && !empty( $_POST[ "qeseo_author" ] )) ? $_POST[ "qeseo_author" ] : ''; 345 346 $valid['qeseo_category'] = (isset( $_POST[ "qeseo_category" ] ) && !empty( $_POST[ "qeseo_category" ] )) ? $_POST[ "qeseo_category" ] : ''; 347 348 $valid['qeseo_tag'] = (isset( $_POST[ "qeseo_tag" ] ) && !empty( $_POST[ "qeseo_tag" ] )) ? $_POST[ "qeseo_tag" ] : ''; 349 350 $valid['qeseo_homepage'] = (isset( $_POST[ "qeseo_homepage" ] ) && !empty( $_POST[ "qeseo_homepage" ] )) ? $_POST[ "qeseo_homepage" ] : ''; 351 352 $valid['qeseo_title_meta_field'] = (isset( $_POST[ "qeseo_title_meta_field" ] ) && !empty( $_POST[ "qeseo_title_meta_field" ] )) ? $_POST[ "qeseo_title_meta_field" ] : ''; 353 354 $valid['qeseo_custom_metades_field'] = (isset( $_POST[ "qeseo_custom_metades_field" ] ) && !empty( $_POST[ "qeseo_custom_metades_field" ] )) ? $_POST[ "qeseo_custom_metades_field" ] : ''; 489 $qeseo_hp_title = sanitize_text_field( $_POST[ "qeseo_hp_title" ] ); 490 $valid['qeseo_hp_title'] = (isset( $qeseo_hp_title ) && !empty( $qeseo_hp_title )) ? $qeseo_hp_title : ''; 491 492 $qeseo_hp_metades = sanitize_text_field( $_POST["qeseo_hp_metades"] ); 493 $valid['qeseo_hp_metades'] = (isset( $qeseo_hp_metades ) && !empty( $qeseo_hp_metades )) ? $qeseo_hp_metades : ''; 494 495 $qeseo_search = sanitize_text_field( $_POST[ "qeseo_search" ] ); 496 $valid['qeseo_search'] = (isset( $qeseo_search ) && !empty( $qeseo_search )) ? $qeseo_search : ''; 497 498 $qeseo_404 = sanitize_text_field($_POST[ "qeseo_404" ]); 499 $valid['qeseo_404'] = (isset( $qeseo_404 ) && !empty( $qeseo_404 )) ? $qeseo_404 : ''; 500 501 $qeseo_attachments = sanitize_text_field($_POST[ "qeseo_attachments" ]); 502 $valid['qeseo_attachments'] = (isset( $qeseo_attachments ) && !empty( $qeseo_attachments )) ? $qeseo_attachments : ''; 503 504 $qeseo_date = sanitize_text_field($_POST[ "qeseo_date" ]); 505 $valid['qeseo_date'] = (isset( $qeseo_date ) && !empty( $qeseo_date )) ? $qeseo_date : ''; 506 507 $qeseo_author = sanitize_text_field($_POST[ "qeseo_author" ]); 508 $valid['qeseo_author'] = (isset( $qeseo_author ) && !empty( $qeseo_author )) ? $qeseo_author : ''; 509 510 $qeseo_category = sanitize_text_field($_POST[ "qeseo_category" ]); 511 $valid['qeseo_category'] = (isset( $qeseo_category ) && !empty( $qeseo_category )) ? $qeseo_category : ''; 512 513 $qeseo_tag = sanitize_text_field($_POST[ "qeseo_tag" ]); 514 $valid['qeseo_tag'] = (isset( $qeseo_tag ) && !empty( $qeseo_tag )) ? $qeseo_tag : ''; 515 516 $qeseo_homepage = sanitize_text_field($_POST[ "qeseo_homepage" ]); 517 $valid['qeseo_homepage'] = (isset( $qeseo_homepage ) && !empty( $qeseo_homepage )) ? $qeseo_homepage : ''; 518 519 $qeseo_title_meta_field = sanitize_text_field($_POST[ "qeseo_title_meta_field" ]); 520 $valid['qeseo_title_meta_field'] = (isset( $qeseo_title_meta_field ) && !empty( $qeseo_title_meta_field )) ? $qeseo_title_meta_field : ''; 521 522 #$valid['qeseo_custom_metades_field'] = (isset( $_POST[ "qeseo_custom_metades_field" ] ) && !empty( $_POST[ "qeseo_custom_metades_field" ] )) ? $_POST[ "qeseo_custom_metades_field" ] : ''; 355 523 356 524 $valid['qeseo_remove_shortlink_tag'] = (isset( $_POST[ "qeseo_remove_shortlink_tag" ] ) && !empty( $_POST[ "qeseo_remove_shortlink_tag" ] )) ? 1 : ''; … … 366 534 $valid['qeseo_remove_xml_rpc_tag'] = (isset( $_POST[ "qeseo_remove_xml_rpc_tag" ] ) && !empty( $_POST[ "qeseo_remove_xml_rpc_tag" ] )) ? 1 : ''; 367 535 368 $valid['qeseo_add_nextprev_archives_field'] = (isset( $_POST[ "qeseo_add_nextprev_archives_field" ] ) && !empty( $_POST[ "qeseo_add_nextprev_archives_field" ] )) ? $_POST[ "qeseo_add_nextprev_archives_field" ] : ''; 369 370 $valid['qeseo_add_nextprev_singlepages_field'] = (isset( $_POST[ "qeseo_add_nextprev_singlepages_field" ] ) && !empty( $_POST[ "qeseo_add_nextprev_singlepages_field" ] )) ? $_POST[ "qeseo_add_nextprev_singlepages_field" ] : ''; 371 536 $valid['qeseo_add_nextprev_archives_field'] = (isset( $_POST[ "qeseo_add_nextprev_archives_field" ] ) && !empty( $_POST[ "qeseo_add_nextprev_archives_field" ] )) ? 1 : ''; 537 538 $valid['qeseo_add_nextprev_singlepages_field'] = (isset( $_POST[ "qeseo_add_nextprev_singlepages_field" ] ) && !empty( $_POST[ "qeseo_add_nextprev_singlepages_field" ] )) ? 1 : ''; 539 540 $valid['qeseo_add_ogtag_field'] = (isset( $_POST[ "qeseo_add_ogtag_field" ] ) && !empty( $_POST[ "qeseo_add_ogtag_field" ] )) ? 1 : ''; 541 542 $qeseo_hp_ogimg_option = trim(esc_url( $_POST[ "qeseo_hp_ogimg" ] )); 543 $valid['qeseo_hp_ogimg_option'] = (isset( $qeseo_hp_ogimg_option ) && !empty( $qeseo_hp_ogimg_option )) ? $qeseo_hp_ogimg_option : ''; 544 545 $qeseo_fb_ogimg_option = trim(esc_url( $_POST[ "qeseo_fb_ogimg" ] )); 546 $valid['qeseo_fb_ogimg_option'] = (isset( $qeseo_fb_ogimg_option ) && !empty( $qeseo_fb_ogimg_option )) ? $qeseo_fb_ogimg_option : ''; 547 548 $qeseo_fb_appid_option = trim(intval( $_POST[ "qeseo_fb_appid" ] )); 549 $valid['qeseo_fb_appid_option'] = (isset( $qeseo_fb_appid_option ) && !empty( $qeseo_fb_appid_option )) ? $qeseo_fb_appid_option : ''; 550 551 $qeseo_fb_admin_option = trim(intval( $_POST[ "qeseo_fb_admin" ] )); 552 $valid['qeseo_fb_admin_option'] = (isset( $qeseo_fb_admin_option ) && !empty( $qeseo_fb_admin_option )) ? $qeseo_fb_admin_option : ''; 553 554 $qeseo_title_separator = trim(sanitize_text_field( $_POST[ "qeseo_title_separator" ] )); 555 $valid['qeseo_title_separator'] = (isset( $qeseo_title_separator ) && !empty( $qeseo_title_separator )) ? $qeseo_title_separator : ''; 556 557 $qeseo_remove_sitename_title = $_POST[ "qeseo_remove_sitename_title" ]; 558 $valid['qeseo_remove_sitename_option'] = (isset( $qeseo_remove_sitename_title ) && !empty( $qeseo_remove_sitename_title )) ? 1 : ''; 559 560 372 561 return $valid; 373 562 … … 382 571 if( $qeseo_meta_box_add_option_check == 'ow_posts_pages_formats' ){ 383 572 $qeseo_all_pub_post_types = get_post_types( array( 'public'=>true ) ); 384 $qeseo_main_pub_post_types = array_diff( $qeseo_all_pub_post_types, array( 'attachment' ) );385 $qeseo_pub_pt_keys = array_keys( $qeseo_main_pub_post_types );573 #$qeseo_main_pub_post_types = array_diff( $qeseo_all_pub_post_types, array( 'attachment' ) ); 574 $qeseo_pub_pt_keys = array_keys( $qeseo_all_pub_post_types ); 386 575 387 576 foreach( $qeseo_pub_pt_keys as $qeseo_pub_pt_key ){ … … 405 594 ?> 406 595 <input type="text" name="qeseo_custom_title_tag_field" id="qeseo_custom_title_tag_field" style="width:100%" value="<?php echo esc_attr( $title_value ) ?>" /> 596 <p class="description"><?php _e('Added by Quick & Easy SEO', 'text_domain'); ?></p> 407 597 <?php 408 598 … … 450 640 public function qeseo_add_metades_tag_metabox(){ 451 641 $ow_title_options = get_option( $this->plugin_name ); 452 $qeseo_meta_box_add_option_check = $ow_title_options[ 'qeseo_ custom_metades_field' ];642 $qeseo_meta_box_add_option_check = $ow_title_options[ 'qeseo_title_meta_field' ]; 453 643 454 644 if( $qeseo_meta_box_add_option_check == 'ow_posts_pages_formats' ){ 455 645 $qeseo_all_pub_post_types = get_post_types( array( 'public'=>true ) ); 456 $qeseo_main_pub_post_types = array_diff( $qeseo_all_pub_post_types, array( 'attachment' ) );457 $qeseo_pub_pt_keys = array_keys( $qeseo_main_pub_post_types );646 #$qeseo_main_pub_post_types = array_diff( $qeseo_all_pub_post_types, array( 'attachment' ) ); 647 $qeseo_pub_pt_keys = array_keys( $qeseo_all_pub_post_types ); 458 648 459 649 foreach( $qeseo_pub_pt_keys as $qeseo_pub_pt_key ){ … … 477 667 ?> 478 668 <textarea name="qeseo_custom_metades_field" id="qeseo_custom_metades_field" cols="40" rows="5" style="width:100%"><?php echo esc_attr( $metades_value ) ?></textarea> 669 <p class="description"><?php _e('Added by Quick & Easy SEO', 'text_domain'); ?></p> 479 670 <?php 480 671 … … 517 708 518 709 } 710 711 712 713 /* Add title/meta-description metabox to woocommerce product category and tag pages */ 714 715 public function qeseo_woo_metades_title_form_fields($term) { 716 717 //getting term ID 718 $qeseo_term_id = $term->term_id; 719 wp_nonce_field( 'qeseo_woo_metades_data', 'qeseo_woo_metades_cate_nonce' ); 720 // retrieve the existing value(s) for this meta field. This returns an array 721 $qeseo_meta = get_option("qeseo_to_" . $qeseo_term_id); 722 $qeseo_title_val = esc_attr(stripslashes($qeseo_meta['qeseo_woocat_title'])); 723 $qeseo_metades_val = esc_attr(stripslashes($qeseo_meta['qeseo_woocat_metades'])); 724 ?> 725 <tr class="form-field"> 726 <th scope="row" valign="top"><label for="qeseo_meta[qeseo_woocat_title]"><?php _e('Custom Title Tag', 'text_domain'); ?></label></th> 727 <td> 728 <input type="text" name="qeseo_meta[qeseo_woocat_title]" id="qeseo_meta[qeseo_woocat_title]" value="<?php echo $qeseo_title_val ? $qeseo_title_val : ''; ?>"> 729 <p class="description"><?php _e('Added by Quick & Easy SEO', 'text_domain'); ?></p> 730 </td> 731 </tr> 732 <tr class="form-field"> 733 <th scope="row" valign="top"><label for="qeseo_meta[qeseo_woocat_metades]"><?php _e('Meta Description Tag', 'text_domain'); ?></label></th> 734 <td> 735 <textarea name="qeseo_meta[qeseo_woocat_metades]" id="qeseo_meta[qeseo_woocat_metades]"><?php echo $qeseo_metades_val ? $qeseo_metades_val : ''; ?></textarea> 736 <p class="description"><?php _e('Added by Quick & Easy SEO', 'text_domain'); ?></p> 737 </td> 738 </tr> 739 <?php 740 } 741 742 /* Callback to save data */ 743 public function qeseo_woo_metades_title_update($term_id) { 744 745 if( ! isset($_POST['qeseo_woo_metades_cate_nonce'] ) ) return; 746 747 if( ! wp_verify_nonce( $_POST['qeseo_woo_metades_cate_nonce'], 'qeseo_woo_metades_data' ) ) return; 748 749 if( ! current_user_can( 'manage_options' ) )return; 750 751 if (isset($_POST['qeseo_meta'])) { 752 $qeseo_meta = get_option("qeseo_to_" . $term_id); 753 $qeseo_keys = array_keys($_POST['qeseo_meta']); 754 foreach ($qeseo_keys as $qeseokey) { 755 if (isset($_POST['qeseo_meta'][$qeseokey])) { 756 $qeseo_meta[$qeseokey] = sanitize_text_field($_POST['qeseo_meta'][$qeseokey]); 757 } 758 } 759 // Save the option array. 760 update_option("qeseo_to_" . $term_id, $qeseo_meta); 761 }else{ 762 return; 763 } 764 } 765 766 519 767 520 768 } -
quick-and-easy-seo-tool/trunk/includes/class-quick-and-easy-seo-activator.php
r1712963 r1837822 36 36 'qeseo_remove_feed_links_tag' => 1, 37 37 'qeseo_remove_xml_rpc_tag' => 1, 38 'qeseo_remove_sitename_title' => 0, 39 'qeseo_title_separator' => '-', 38 40 'qeseo_title_meta_field' => 'ow_posts_pages_formats', 39 'qeseo_custom_metades_field' => 'ow_posts_pages_formats', 40 'qeseo_add_nextprev_archives_field' => 'yes', 41 'qeseo_add_nextprev_singlepages_field' => 'yes' 41 #'qeseo_custom_metades_field' => 'ow_posts_pages_formats', 42 'qeseo_add_nextprev_archives_field' => 1, 43 'qeseo_add_nextprev_singlepages_field' => 1, 44 'qeseo_add_ogtag_field' => 1 42 45 43 46 ); -
quick-and-easy-seo-tool/trunk/includes/class-quick-and-easy-seo.php
r1714633 r1837822 30 30 31 31 $this->plugin_name = 'quick-and-easy-seo'; 32 $this->version = '1. 0.0';32 $this->version = '1.4.1'; 33 33 34 34 $this->load_dependencies(); … … 62 62 63 63 $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ) ; 64 /*Use this to load plugin scripts*/ 65 #$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); 66 67 /*Plugin forms and meta boxes*/ 64 68 $this->loader->add_filter( 'plugin_action_links_'.$plugin_basename, $plugin_admin, 'qeseo_plug_settings_link' ); 65 69 $this->loader->add_action( 'admin_menu', $plugin_admin, 'qeseo_add_sb_menu_link' ); … … 69 73 $this->loader->add_action( 'save_post', $plugin_admin, 'qeseo_title_tag_data' ); 70 74 $this->loader->add_action( 'save_post', $plugin_admin, 'qeseo_metades_data' ); 75 /* save media attachment tags*/ 76 $this->loader->add_action( 'edit_attachment', $plugin_admin, 'qeseo_title_tag_data' ); 77 $this->loader->add_action( 'edit_attachment', $plugin_admin, 'qeseo_metades_data' ); 78 /* Add meta box and update options for woocommerce product category and tag pages */ 79 $this->loader->add_action('product_cat_edit_form_fields', $plugin_admin, 'qeseo_woo_metades_title_form_fields'); 80 $this->loader->add_action('product_tag_edit_form_fields', $plugin_admin, 'qeseo_woo_metades_title_form_fields'); 81 $this->loader->add_action('edited_product_cat', $plugin_admin, 'qeseo_woo_metades_title_update'); 82 $this->loader->add_action('edited_product_tag', $plugin_admin, 'qeseo_woo_metades_title_update'); 71 83 72 84 } … … 78 90 79 91 $this->loader->add_filter( 'document_title_parts', $plugin_public, 'qeseo_add_custom_title_tag' ); 80 #$this->loader->add_action( 'init', $plugin_public, 'qeseo_remove_unwated_head_tags' ); 92 /* Set title tag sep */ 93 $this->loader->add_filter( 'document_title_separator', $plugin_public, 'qeseo_title_tag_sep' ); 81 94 $this->loader->add_action( 'wp_head', $plugin_public, 'qeseo_print_all_values', 2 ); 82 83 84 }95 /* Add facebook og tag prefix*/ 96 $this->loader->add_action( 'language_attributes', $plugin_public, 'qeseo_fb_og_prefix' ); 97 } 85 98 86 99 /* Run the loader to execute all of the hooks with WordPress. */ -
quick-and-easy-seo-tool/trunk/public/class-quick-and-easy-seo-public.php
r1714633 r1837822 16 16 private $version; 17 17 private $qeseo_options; 18 19 18 20 19 /** 21 20 * Initialize the class and set its properties. … … 31 30 /* Remove tags */ 32 31 $this->qeseo_remove_unwated_head_tags(); 33 32 33 } 34 35 36 /* Check if woocommerce is installed */ 37 public function qeseo_check_woo_exists(){ 38 if(class_exists( 'WooCommerce' )){ 39 $woo_installed = 1; 40 }else{ 41 $woo_installed = 0; 42 } 43 44 return $woo_installed; 34 45 } 35 46 … … 37 48 public function qeseo_add_robots_tags(){ 38 49 39 $qeseo_follow = "<meta name='Robots' content='noindex,follow' /> ";40 $qeseo_nofollow = "<meta name='Robots' content='noindex,noFollow' /> ";50 $qeseo_follow = "<meta name='Robots' content='noindex,follow' /> "; 51 $qeseo_nofollow = "<meta name='Robots' content='noindex,noFollow' /> "; 41 52 42 53 /* Search pages*/ … … 85 96 $paged = get_query_var( 'paged' ); 86 97 $paged = intval( $paged ); 87 $qeseo_follow = "<meta name='robots' content='noindex,follow' /> ";88 $qeseo_nofollow = "<meta name='robots' content='noindex,nofollow' /> ";98 $qeseo_follow = "<meta name='robots' content='noindex,follow' /> "; 99 $qeseo_nofollow = "<meta name='robots' content='noindex,nofollow' /> "; 89 100 90 101 /* Date archives */ … … 178 189 179 190 } 191 192 /* Check if homepage is posts or page and return URL */ 193 194 public function qeseo_hp_url(){ 195 $qeseo_hp_display = get_option( 'show_on_front' ); 196 if( $qeseo_hp_display === 'page' ){ 197 $post_page_url = get_permalink( get_option( 'page_for_posts' )); 198 }else{ 199 $post_page_url = get_home_url(); 200 } 201 return esc_url($post_page_url); 202 } 203 204 /* Title tag separator setting */ 205 206 public function qeseo_title_tag_sep( $sep ){ 207 if( isset($this->qeseo_options['qeseo_title_separator']) && !empty($this->qeseo_options['qeseo_title_separator']) && $this->qeseo_options['qeseo_title_separator'] !== '-' ){ 208 $qeseo_title_tag_sep = trim(esc_html($this->qeseo_options['qeseo_title_separator'])); 209 if( $qeseo_title_tag_sep == 'bdash') $qeseo_title_tag_sep = '—'; 210 if( $qeseo_title_tag_sep == 'darrow') $qeseo_title_tag_sep = '»'; 211 if( $qeseo_title_tag_sep == 'bdot') $qeseo_title_tag_sep = '•'; 212 if( $qeseo_title_tag_sep == 'diamond') $qeseo_title_tag_sep = '♦'; 213 if( $qeseo_title_tag_sep == 'hearts') $qeseo_title_tag_sep = '♥'; 214 return $qeseo_title_tag_sep; 215 }else{ 216 return $sep; 217 } 218 } 219 220 /* */ 221 222 public function qeseo_woo_cat_tag_options(){ 223 $qeseo_query_obj = get_queried_object(); 224 $qeseo_term_id = $qeseo_query_obj->term_id; 225 $qeseo_meta = get_option("qeseo_to_" . $qeseo_term_id); 226 return $qeseo_meta; 227 } 228 229 /* Title output for homepage */ 230 public function qeseo_title_output(){ 231 $title_output = ''; 232 /* Check if frontpage is posts or page */ 233 if( is_home() || is_front_page() ){ 234 $hp_display = get_option( 'show_on_front' ); 235 /* If posts */ 236 if( $hp_display === 'posts' ){ 237 $qeseo_custom_title = trim($this->qeseo_options[ 'qeseo_hp_title' ]); 238 if( isset($qeseo_custom_title) && !empty($qeseo_custom_title) ){ 239 $title_output = trim(stripslashes(esc_html($qeseo_custom_title))); 240 } 241 } 242 /* is a static page is being used */ 243 if( $hp_display === 'page' ){ 244 if( is_front_page() ){ 245 $qeseo_custom_title = trim($this->qeseo_options[ 'qeseo_hp_title' ]); 246 if( isset($qeseo_custom_title) && !empty($qeseo_custom_title) ){ 247 $title_output = trim(stripslashes(esc_html($qeseo_custom_title))); 248 }else{ 249 $title_output = get_post_meta( get_the_id(), '_qeseo_title_tag_meta_value', true ); 250 /* If nothing is set, return single page title */ 251 if( !isset( $title_output ) || empty( $title_output ) ){ 252 $spid = intval(get_the_id()); 253 $title_output = get_the_title($spid); 254 } 255 } 256 }else{ 257 $spid = get_option( 'page_for_posts' ); 258 $title_output = get_post_meta( $spid, '_qeseo_title_tag_meta_value', true ); 259 } 260 } 261 } 262 if( is_singular() && !is_front_page() && !is_home() ){ 263 $title_output = get_post_meta( get_the_id(), '_qeseo_title_tag_meta_value', true ); 264 if( !isset( $title_output ) || empty($title_output) ){ 265 $title_output = get_the_title(); 266 } 267 } 268 269 if( $this->qeseo_check_woo_exists() ){ 270 if( is_product_category() || is_product_tag() ){ 271 $qeseo_meta = $this->qeseo_woo_cat_tag_options(); 272 $title_output = trim(stripslashes(esc_html($qeseo_meta['qeseo_woocat_title']))); 273 if( !isset( $title_output ) || empty( $title_output ) ){ 274 $title_output = single_cat_title('',false); 275 } 276 } 277 } 278 return esc_html($title_output); 279 } 280 180 281 181 282 /* Add custom title tag */ 182 183 283 public function qeseo_add_custom_title_tag( $title ){ 184 185 if( ! is_singular() ){ 186 return $title; 187 } 188 284 $qeseo_custom_title = ''; 285 $qeseo_remove_sitetitle = 0; 286 /* Remove site title from title tag */ 287 if( isset($this->qeseo_options[ 'qeseo_remove_sitename_option' ]) && !empty($this->qeseo_options[ 'qeseo_remove_sitename_option' ])){ 288 $qeseo_remove_sitetitle = $this->qeseo_options[ 'qeseo_remove_sitename_option' ]; 289 } 290 if( $qeseo_remove_sitetitle ){ 291 $title['site'] = ''; 292 } 293 294 if( is_home() || is_front_page() ){ 295 $title_output = $this->qeseo_title_output(); 296 if( isset( $title_output ) && !empty( $title_output ) ){ 297 $title['title'] = $this->qeseo_title_output(); 298 $title['tagline'] = ''; 299 } 300 } 301 302 if( is_singular() && !is_home() && !is_front_page() ){ 303 global $post; 304 $qeseo_custom_title = get_post_meta( $post->ID, '_qeseo_title_tag_meta_value', true ); 305 $qeseo_custom_title = trim(esc_html(strip_tags($qeseo_custom_title))); 306 if( ! isset( $qeseo_custom_title ) || empty( $qeseo_custom_title ) ) return $title; 307 $title['title'] = trim(stripslashes(esc_html(strip_tags($qeseo_custom_title)))); 308 } 309 310 if( $this->qeseo_check_woo_exists() ){ 311 if( is_product_category() || is_product_tag() ){ 312 $qeseo_meta = $this->qeseo_woo_cat_tag_options(); 313 $qeseo_custom_title = trim(stripslashes(esc_html($qeseo_meta['qeseo_woocat_title']))); 314 if( ! isset( $qeseo_custom_title ) || empty( $qeseo_custom_title ) ) return $title; 315 $title['title'] = trim(stripslashes(esc_html(strip_tags($qeseo_custom_title)))); 316 } 317 318 if( is_shop()){ 319 $shop_id = get_option( 'woocommerce_shop_page_id' ); 320 $shop_title = get_post_meta( $shop_id, '_qeseo_title_tag_meta_value', true ); 321 if( !isset($shop_title) || empty($shop_title) ){ 322 $shop_title = get_the_title($shop_id); 323 } 324 if( isset($shop_title) && !empty($shop_title) ){ 325 $title['title'] = trim(stripslashes(esc_html($shop_title))); 326 }else{ 327 return $title; 328 } 329 } 330 } 331 return $title; 332 } 333 334 /* Generate meta description from content */ 335 336 public function qeseo_generate_metades_content(){ 189 337 global $post; 190 $qeseo_custom_title = get_post_meta( $post->ID, '_qeseo_title_tag_meta_value', true ); 191 192 if( ! isset( $qeseo_custom_title ) || empty( $qeseo_custom_title ) ){ 193 return $title; 194 } 195 196 $qeseo_custom_title = sanitize_text_field( $qeseo_custom_title ); 197 $qeseo_custom_title = esc_html( $qeseo_custom_title ); 198 $title['title'] = $qeseo_custom_title; 199 200 return $title; 201 } 202 338 $qeseo_custom_metades = ''; 339 $qeseo_custom_metades = stripslashes(esc_html(strip_shortcodes(strip_tags($post->post_content)))); 340 $qeseo_custom_metades = str_replace(array("\n", "\r", "\t"), ' ', $qeseo_custom_metades); 341 $qeseo_custom_metades = substr($qeseo_custom_metades, 0, 155); 342 $qeseo_lastpos = strrpos($qeseo_custom_metades, ' '); 343 $qeseo_custom_metades = substr($qeseo_custom_metades, 0, $qeseo_lastpos); 344 $qeseo_custom_metades = $qeseo_custom_metades . '..'; 345 return trim(esc_html($qeseo_custom_metades)); 346 } 347 348 /* Meta description output for homepage */ 349 public function qeseo_hp_meta_des_output(){ 350 $qeseo_og_des = ''; 351 $hp_display = get_option( 'show_on_front' ); 352 if( $hp_display === 'posts' ){ 353 if( isset($this->qeseo_options['qeseo_hp_metades']) && !empty($this->qeseo_options['qeseo_hp_metades'])){ 354 $qeseo_og_des = trim(esc_attr($this->qeseo_options['qeseo_hp_metades'])); 355 } 356 } 357 /* If it's a static page */ 358 if( $hp_display === 'page' ){ 359 if( is_front_page() ){ 360 if( isset($this->qeseo_options['qeseo_hp_metades']) && !empty($this->qeseo_options['qeseo_hp_metades'])){ 361 $qeseo_og_des = trim(esc_attr($this->qeseo_options['qeseo_hp_metades'])); 362 }else{ 363 $qeseo_og_des = get_post_meta( get_the_ID(), '_qeseo_metades_meta_value', true ); 364 } 365 }else{ 366 $spid = get_option( 'page_for_posts' ); 367 $qeseo_og_des = get_post_meta( $spid, '_qeseo_metades_meta_value', true ); 368 } 369 } 370 return $qeseo_og_des; 371 } 372 373 374 /* Add meta description all pages except homepage output */ 375 public function qeseo_metades_func(){ 376 $qeseo_custom_metades = trim(get_post_meta( get_the_id(), '_qeseo_metades_meta_value', true )); 377 if( !isset($qeseo_custom_metades) || empty( $qeseo_custom_metades ) ){ 378 $qeseo_custom_metades = ''; 379 if( is_single() || is_page() ) 380 $qeseo_custom_metades = $this->qeseo_generate_metades_content(); 381 }else{ 382 $qeseo_custom_metades = trim(stripslashes(esc_html(strip_tags( $qeseo_custom_metades )))); 383 } 384 return $qeseo_custom_metades; 385 } 386 203 387 /* Add custom Meta description tag */ 204 388 public function qeseo_add_custom_metades_tag(){ 205 389 $qeseo_custom_metades = ''; 390 if( is_home() || is_front_page() ){ 391 $qeseo_hp_metades = $this->qeseo_hp_meta_des_output(); 392 if( isset($qeseo_hp_metades) && !empty($qeseo_hp_metades) ){ 393 $qeseo_custom_metades = "<meta name='description' content='$qeseo_hp_metades'/> \n"; 394 } 395 return $qeseo_custom_metades; 396 } 206 397 /* Output custom meta description for single posts/pages/custom-post-types if set */ 207 if( is_singular() ){ 208 global $post; 209 $qeseo_custom_metades = ''; 210 $qeseo_custom_metades = get_post_meta( $post->ID, '_qeseo_metades_meta_value', true ); 211 212 if( !empty( $qeseo_custom_metades ) ){ 213 $qeseo_custom_metades = strip_tags( $qeseo_custom_metades ); 214 $qeseo_custom_metades = sanitize_text_field( $qeseo_custom_metades ); 215 $qeseo_custom_metades = "<meta name='description' content='$qeseo_custom_metades' />"; 398 if( is_singular() && !is_front_page() && !is_home() ){ 399 $qeseo_custom_metades = $this->qeseo_metades_func(); 400 if( isset($qeseo_custom_metades) && !empty($qeseo_custom_metades)){ 401 $qeseo_custom_metades = "<meta name='description' content='$qeseo_custom_metades'/> \n"; 402 } 403 return $qeseo_custom_metades; 404 } 405 /* Meta description for Woocomerce product category and tag pages */ 406 if( $this->qeseo_check_woo_exists() ){ 407 if( is_product_category() || is_product_tag() ){ 408 $qeseo_meta = $this->qeseo_woo_cat_tag_options(); 409 $qeseo_custom_metades = trim($qeseo_meta['qeseo_woocat_metades']); 410 411 if( ! isset( $qeseo_custom_metades ) || empty( $qeseo_custom_metades ) ) { 412 $qeseo_query_obj = get_queried_object(); 413 $qeseo_term_id = $qeseo_query_obj->term_id; 414 $qeseo_custom_metades = trim(term_description( $qeseo_term_id )); 415 } 416 $qeseo_custom_metades = trim(stripslashes(esc_html(strip_tags( $qeseo_custom_metades )))); 417 418 if( isset($qeseo_custom_metades) && !empty($qeseo_custom_metades)){ 419 $qeseo_custom_metades = "<meta name='description' content='$qeseo_custom_metades'/> \n"; 216 420 return $qeseo_custom_metades . "\n"; 217 } 218 } 219 } 220 421 } 422 } 423 } 424 /* Meta description for woocommerce shop page */ 425 if( $this->qeseo_check_woo_exists() ){ 426 if( is_shop() ){ 427 $shop_id = get_option( 'woocommerce_shop_page_id' ); 428 $shop_metades = get_post_meta( $shop_id, '_qeseo_metades_meta_value', true ); 429 if( isset($shop_metades) && !empty($shop_metades) ){ 430 $qeseo_custom_metades = "<meta name='description' content='$shop_metades'/> \n"; 431 return $qeseo_custom_metades . "\n"; 432 } 433 } 434 } 435 } 221 436 /* Add Meta description tag for category/tag pages if present */ 437 222 438 public function qeseo_meta_des_archives(){ 439 if( $this->qeseo_check_woo_exists() ){ 440 if( is_product_category() || is_product_tag() ) return; 441 } 442 223 443 /* Output meta description for category/tag pages */ 224 444 if( is_category() || is_tag() || is_tax() ){ … … 226 446 $qeseo_term_des = term_description( $qeseo_term_id ); 227 447 228 if( !empty( $qeseo_term_des ) ){ 229 $qeseo_term_des = strip_tags($qeseo_term_des); 230 $qeseo_term_des = sanitize_text_field($qeseo_term_des); 231 $qeseo_term_meta_des = "<meta name='description' content='$qeseo_term_des' />"; 448 if( isset($qeseo_term_des) && !empty( $qeseo_term_des ) ){ 449 $qeseo_term_des = trim(stripslashes(esc_attr(strip_tags($qeseo_term_des)))); 450 $qeseo_term_meta_des = "<meta name='description' content='$qeseo_term_des' /> "; 232 451 return $qeseo_term_meta_des . "\n"; 233 452 } 234 453 } 235 454 } 455 456 /* Add og prefix if not present */ 457 public function qeseo_fb_og_prefix($tagdata) { 458 if(is_home() || is_front_page() || is_singular()){ 459 $qeseo_ogtags_option = trim($this->qeseo_options['qeseo_add_ogtag_field']); 460 if( ! $qeseo_ogtags_option ) return $tagdata; 461 if($qeseo_ogtags_option == 'no') return $tagdata; 462 463 if( (strpos( $tagdata, '//ogp.me/ns#' ) !== false) ) return $tagdata; 464 $tagdata .= " prefix='og: http://ogp.me/ns#' "; 465 return $tagdata; 466 } 467 } 468 /* Add select og tags for single posts, pages and post formats */ 469 public function qeseo_add_og_tags(){ 470 $qeseo_ogtags_option = trim($this->qeseo_options['qeseo_add_ogtag_field']); 471 global $post; 472 $qeseo_og_output = ''; 473 if( ! $qeseo_ogtags_option ) return; 474 $qeseo_og_sitename = esc_attr(get_bloginfo( 'name' )); 475 if(!empty($qeseo_og_sitename)){ 476 $qeseo_og_output .= "<meta property='og:site_name' content='$qeseo_og_sitename'/> \n"; 477 } 478 if( is_home() || is_front_page() ){ 479 #$qeseo_og_des = ''; 480 $qeseo_og_title = ''; 481 #$qeseo_og_url = ''; 482 483 #$qeseo_og_des = $this->qeseo_hp_meta_des_output(); 484 $qeseo_og_title = $this->qeseo_title_output(); 485 if( !isset($qeseo_og_title) || empty($qeseo_og_title) ){ 486 $qeseo_og_title = $qeseo_og_sitename; 487 } 488 /*if( is_front_page() ){ 489 $qeseo_og_url = esc_url( get_home_url() ); 490 }else{ 491 $qeseo_og_url = esc_url(get_permalink( get_option( 'page_for_posts' ) )); 492 }*/ 493 494 /*Output*/ 495 /*if( isset( $qeseo_og_url ) && !empty( $qeseo_og_url ) ){ 496 $qeseo_og_output .= "<meta property='og:url' content='$qeseo_og_url'/> \n"; 497 }*/ 498 if( isset($qeseo_og_title) && !empty($qeseo_og_title) ){ 499 $qeseo_og_output .= "<meta property='og:title' content='$qeseo_og_title'/> \n"; 500 } 501 /*if( isset($qeseo_og_des) && !empty($qeseo_og_des) ){ 502 $qeseo_og_output .= "<meta property='og:description' content='$qeseo_og_des'/> \n"; 503 }*/ 504 } 505 506 /* OG Image for frontpage */ 507 if( is_front_page() || is_home() ){ 508 if( has_post_thumbnail( get_the_id() ) ){ 509 /* check if featured image is present */ 510 $qeseo_hp_img = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_id() ), 'full', false); 511 $qeseo_hp_img = trim(esc_url( $qeseo_hp_img[0] )); 512 }else{ 513 /* Check fallback image if featured image is absent */ 514 if( isset($this->qeseo_options['qeseo_hp_ogimg_option']) && !empty($this->qeseo_options['qeseo_hp_ogimg_option']) ){ 515 $qeseo_hp_img = trim(esc_url($this->qeseo_options['qeseo_hp_ogimg_option'])); 516 } 517 } 518 if( isset( $qeseo_hp_img ) && !empty( $qeseo_hp_img ) ){ 519 $qeseo_og_output .= "<meta property='og:image' content='$qeseo_hp_img'/> \n"; 520 } 521 } 522 523 /* Featured image for woocommerce shop page*/ 524 if( $this->qeseo_check_woo_exists() ){ 525 if( is_shop() ){ 526 $shop_id = get_option( 'woocommerce_shop_page_id' ); 527 $qeseo_og_img = wp_get_attachment_image_src(get_post_thumbnail_id( $shop_id ), 'full', false); 528 $qeseo_og_img = esc_url($qeseo_og_img[0]); 529 530 if( isset($qeseo_og_img) && !empty($qeseo_og_img) ){ 531 $qeseo_og_output .= "<meta property='og:image' content='$qeseo_og_img'/> \n"; 532 } 533 534 } 535 } 536 537 /* Tags for posts, pages, post formats */ 538 if( is_singular() ){ 539 if( ! is_home() && ! is_front_page() ){ 540 $qeseo_og_img = ''; 541 /* section working on*/ 542 $qeseo_og_title = $this->qeseo_title_output(); 543 #$qeseo_og_url = esc_url( get_permalink() ); 544 #$qeseo_og_des = $this->qeseo_metades_func(); 545 546 if( has_post_thumbnail($post->ID) ){ 547 /* check if featured image is present */ 548 $qeseo_og_img = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'full', false); 549 $qeseo_og_img = esc_url($qeseo_og_img[0]); 550 551 }else{ 552 /* Check fallback image if featured image is absent */ 553 if( isset($this->qeseo_options['qeseo_fb_ogimg']) && !empty($this->qeseo_options['qeseo_fb_ogimg']) ){ 554 $qeseo_og_img = trim(esc_url($this->qeseo_options['qeseo_fb_ogimg'])); 555 } 556 } 557 /* Og tags output */ 558 /*if( isset($qeseo_og_url) && !empty($qeseo_og_url) ){ 559 $qeseo_og_output .= "<meta property='og:url' content='$qeseo_og_url'/> \n"; 560 }*/ 561 if( isset($qeseo_og_title) && !empty($qeseo_og_title) ){ 562 $qeseo_og_output .= "<meta property='og:title' content='$qeseo_og_title'/> \n"; 563 } 564 /*if( isset($qeseo_og_des) && !empty($qeseo_og_des) ){ 565 $qeseo_og_output .= "<meta property='og:description' content='$qeseo_og_des'/> \n"; 566 }*/ 567 if( isset($qeseo_og_img) && !empty($qeseo_og_img) ){ 568 $qeseo_og_output .= "<meta property='og:image' content='$qeseo_og_img'/> \n"; 569 } 570 }} 571 572 if( isset($this->qeseo_options['qeseo_fb_appid_option']) && !empty($this->qeseo_options['qeseo_fb_appid_option']) ){ 573 $qeseo_fb_appid = trim(intval($this->qeseo_options['qeseo_fb_appid_option'])); 574 } 575 576 if( isset($this->qeseo_options['qeseo_fb_appid_option']) && !empty($this->qeseo_options['qeseo_fb_appid_option']) ){ 577 $qeseo_fb_admin = trim(intval($this->qeseo_options['qeseo_fb_admin_option'])); 578 } 579 580 581 if( isset( $qeseo_fb_appid ) && !empty( $qeseo_fb_appid ) ){ 582 $qeseo_og_output .= "<meta property='fb:app_id' content='$qeseo_fb_appid'/> \n"; 583 } 584 585 if( isset( $qeseo_fb_admin ) && !empty( $qeseo_fb_admin ) ){ 586 $qeseo_og_output .= "<meta property='fb:admins' content='$qeseo_fb_admin'/> \n"; 587 } 588 589 return "<!-- OG Tags -->\n" . $qeseo_og_output; 590 } 591 236 592 237 593 /* Remove unwanted tags */ … … 262 618 remove_action('wp_head', 'rsd_link'); 263 619 } 620 621 remove_action('wp_head', 'rel_canonical'); 264 622 } 265 623 … … 269 627 $qeseo_nextprev_archives_option = $this->qeseo_options['qeseo_add_nextprev_archives_field']; 270 628 271 if( $qeseo_nextprev_archives_option == 'yes'){272 273 if( is_ archive() || is_home() || is_front_page() ){629 if( $qeseo_nextprev_archives_option ){ 630 631 if( is_singular() || is_archive() || is_home() || is_front_page() ){ 274 632 global $wp_rewrite, $wp_query; 275 633 … … 280 638 $pnumber = intval( get_query_var( 'paged' ) ); 281 639 640 if( is_single() ){ 641 $basepaginate = ''; 642 $pnumber = get_query_var('page'); 643 } 644 282 645 if($pnumber == 0){ $pnumber = 1; } 283 646 $qeseo_perm_link = ''; … … 285 648 /*Get permalink for homepage*/ 286 649 if( is_home() || is_front_page() ){ 287 $qeseo_perm_link = get_option('siteurl'); 650 $hp_display = get_option( 'show_on_front' ); 651 /* Generate separate URL if posts page is different from homepage */ 652 if( $hp_display === 'page' ){ 653 $qeseo_perm_link = esc_url(get_home_url()); 654 if( ! is_front_page() ){ 655 $qeseo_perm_link = get_permalink( get_option( 'page_for_posts' ) ); 656 } 657 }else{ 658 $qeseo_perm_link = esc_url(get_home_url()); 659 } 660 } 661 662 if( is_single() || is_page() ){ 663 $qeseo_perm_link = get_permalink(); 288 664 } 289 665 … … 330 706 $qeseo_canonical_link = user_trailingslashit(trailingslashit($qeseo_perm_link)); 331 707 $qeseo_canonical_link = esc_url($qeseo_canonical_link); 332 $qeseo_canonical_link = "<link rel='canonical' href='$qeseo_canonical_link' >\n";708 $qeseo_canonical_link = "<link rel='canonical' href='$qeseo_canonical_link'/>\n"; 333 709 }else{ 334 710 $qeseo_canonical_link = user_trailingslashit(trailingslashit($qeseo_perm_link) . $basepaginate . $pnumber); 335 711 $qeseo_canonical_link = esc_url($qeseo_canonical_link); 336 $qeseo_canonical_link = "<link rel='canonical' href='$qeseo_canonical_link' >\n";712 $qeseo_canonical_link = "<link rel='canonical' href='$qeseo_canonical_link'/>\n"; 337 713 } 338 714 … … 369 745 $qeseo_nextprev_singlepages_option = $this->qeseo_options['qeseo_add_nextprev_singlepages_field']; 370 746 371 if( $qeseo_nextprev_singlepages_option == 'yes'){747 if( $qeseo_nextprev_singlepages_option ){ 372 748 373 749 global $post; … … 432 808 } 433 809 434 /* Output next/prev tag for pagin ted archives */810 /* Output next/prev tag for paginated archives */ 435 811 if( $this->qeseo_add_prev_next_archives() ){ 436 812 echo $this->qeseo_add_prev_next_archives(); 437 813 } 438 814 439 /* Output next/prev tag for pagin ted single post pages */815 /* Output next/prev tag for paginated single post pages */ 440 816 if( $this->qeseo_prev_next_rel_paginated_posts() ){ 441 817 echo $this->qeseo_prev_next_rel_paginated_posts(); 442 818 } 443 819 444 } 820 /* Output og tags */ 821 if( $this->qeseo_add_og_tags() ){ 822 echo $this->qeseo_add_og_tags(); 823 } 824 } 825 826 445 827 446 828 /* Main Output */ 447 829 public function qeseo_print_all_values(){ 448 449 /* Check if output is present */ 830 /* Check if output is present */ 450 831 ob_start(); 451 832 $this->qeseo_pre_output_store(); … … 456 837 if( !empty( $qeseo_output ) ){ 457 838 echo "\n <!--Added by Quick and Easy SEO --> \n"; 458 $this->qeseo_pre_output_store(); 839 $qeseo_output = preg_replace("/[\r\n]+/", "\n", $qeseo_output); 840 #$qeseo_output = preg_replace("/([\r\n]{4,}|[\n]{2,}|[\r]{2,})/", "\n", $qeseo_output); #remove double line breaks 841 #$qeseo_output = explode( '>', $qeseo_output ); 842 843 /* Create og url from canonical tag if it exists */ 844 $cano_pos = strpos($qeseo_output, 'canonical'); 845 $ogtag_pos = stripos($qeseo_output, 'OG TAGS'); 846 if( $cano_pos > 0 && $ogtag_pos > 0 ){ 847 $http_pos = strpos($qeseo_output, 'http', $cano_pos); 848 $arrow_pos = strpos($qeseo_output, '>', $http_pos); 849 $qeseo_ogurl = substr($qeseo_output, $http_pos, ($arrow_pos - $http_pos) - 2 ); 850 #$ogurl_end = strpos($ogurl2, '\''); 851 #$qeseo_ogurl = esc_url(substr($ogurl2, 0, $ogurl_end)); 852 $qeseo_ogurl = "<meta property='og:url' content='$qeseo_ogurl'/> \n"; 853 $qeseo_output .= $qeseo_ogurl; 854 } 855 856 /* Create og description from meta description tag if it exists */ 857 $des_pos = strpos($qeseo_output, 'description'); 858 if( $des_pos > 0 && $ogtag_pos > 0 ){ 859 $con_pos = strpos($qeseo_output, 'content', $des_pos); 860 $arrow_pos = strpos($qeseo_output, '>', $con_pos); 861 $ogdes = substr($qeseo_output, $con_pos, ($arrow_pos - $con_pos) - 1 ); 862 $qeseo_ogdes = "<meta property='og:description' $ogdes/> \n"; 863 $qeseo_output .= $qeseo_ogdes; 864 } 865 echo $qeseo_output; 459 866 echo "<!--Added by Quick and Easy SEO --> \n\n"; 460 867 } -
quick-and-easy-seo-tool/trunk/quick-and-easy-seo.php
r1712963 r1837822 3 3 /** 4 4 * Plugin Name: Quick And Easy SEO Tool 5 * Description: A fully configured SEO plugin to make your blog 100% SEO friendly - blocks indexing of duplicate pages, allows custom title/meta tags and more..6 * Version: 1. 0.05 * Description: A light weight plugin that fixes all SEO loopholes in wordpress. Woocommerce Compatible. 6 * Version: 1.4.1 7 7 * Author: Mukesh Mani 8 8 * Author URI: http://orbitingweb.com
Note: See TracChangeset
for help on using the changeset viewer.