Changeset 1790958
- Timestamp:
- 12/21/2017 10:54:06 PM (8 years ago)
- File:
-
- 1 edited
-
eve-dynamic-prerender/trunk/eve_prerender.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eve-dynamic-prerender/trunk/eve_prerender.php
r1790920 r1790958 3 3 Plugin Name: EVE Dynamic Prerender Meta Tag 4 4 Plugin URI: https://www.evemilano.com/2017/11/wp-prerender-plugin/ 5 Version: 3.5 5 Version: 3.5.2 6 6 Description: This WordPress plugin creates and inject into HTML head a Dynamic Prerender Meta Tag. The system stores users navigational paths inside the database e retrieve the most common next visited page as prerender meta tag. If the plugin doesn't has data for the next probable page, it will show a prerender to the homepage. The database table WILL BE REMOVED automatically when the plugin is uninstalled but not when disabled. Do not remove the plugin if you want to keep data. The database table can grow up a lot in large websites, keep an eye on it! 7 7 Author: Giovanni Sacheli … … 49 49 //echo 'c: '.$canonical; 50 50 51 //inserting data if internal referer, no .js and no .txt 52 //AND ($canonical != 0) AND ($relreferer != 0) 53 if ( (!isset($canonical)=== false) AND (!isset($relreferer)=== false) AND ((null === $canonical)=== false) AND ((null === $relreferer)=== false) ) { 51 //inserting data if... 52 if ( (!isset($canonical)=== false) AND (!isset($relreferer)=== false) AND ($canonical != $relreferer) AND ($canonical != 0) AND ($relreferer != 0) ) { 54 53 $wpdb->query("INSERT INTO $table_name (ID,canonical,prerender,count) VALUES (NULL,'$relreferer','$canonical','1') ON DUPLICATE KEY UPDATE count = count +1" ); 55 54 //test … … 82 81 add_action('wp_head', 'eve_prerender' ); 83 82 84 // Delete table when deactivate 85 function my_plugin_remove_database() { 83 // reset auto-increment when deactivate 84 function reset_id() { 85 global $wpdb; 86 $table_name = $wpdb->prefix . "PRERENDER"; 87 $sql = "ALTER TABLE $table_name AUTO_INCREMENT = 1;"; 88 $wpdb->query($sql); 89 } 90 register_deactivation_hook ( __FILE__, 'reset_id' ); 91 92 // Delete table when uninstall 93 function remove_db() { 86 94 global $wpdb; 87 95 $table_name = $wpdb->prefix . "PRERENDER"; … … 90 98 delete_option("my_plugin_db_version"); 91 99 } 92 register_uninstall_hook( __FILE__, ' my_plugin_remove_database' );100 register_uninstall_hook( __FILE__, 'remove_db' );
Note: See TracChangeset
for help on using the changeset viewer.