MyBB Community Forums

Full Version: [Release 1.4/1.6] Master Meta Tags 1.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi All,

With the need of having better plugin which creates dynamic meta keywords and description, I thought of writing one myself.

[Image: 23184-1281157892-mmt1.png]

Download Link: http://mods.mybb.com/view/master-meta-tags

I am not expert in keyword and description generation as per SEO standards; hence anyone who has idea to improve the plugin for better results, please share it with me and I shall incorporate those changes as soon as possible.

Changelog:

Version 1.1
Modified Random option to be Yes/No
Solved several warnings when forum had no threads.



Awesome
Interesting; I'm curious to see what people think of this vs. the Google SEO plugin...
@jmeeter - This plugin stands nowhere in front of Google SEO plugin. All this plugin does is generating meta keywords and description which is just a small subset of complete SEO package offered by Google SEO plugin.

But the complete seo package offered by the google seo plugin is a resource hog. :p

Thank you for this plugin. For someone who doesn't believe in seo very much, this is a good one. Wink
(2010-08-07, 10:00 PM)HolyPhoenix Wrote: [ -> ]But the complete seo package offered by the google seo plugin is a resource hog. :p

[rant]
The only thing that does use some resources is the URL component of Google SEO, and you don't have to enable that if you don't want to. Google SEO does not even load the URL code if you do not enable the option.

This plugin uses database queries to build description and keywords. 2 queries for forum pages, 4 queries for thread pages. In comparison, the Meta component of Google SEO uses 0 queries. So in a manner of speaking, this plugin is more of a resource hog than Google SEO.

Originally, Google SEO Meta used the same approach as this plugin - a variable in the headerinclude template. Caveat is that template variables have to be initialized before the template is evaluated, which unfortunately and unnecessarily, happens early on for the headerinclude template.

So your variables have to be initialized early on too, so you're not able to use hooks that would provide the data you need for free, and instead you have to run expensive database queries to get at the data yourself.

I abandoned this approach in Google SEO, instead it makes use of hooks properly, and just adds the tags to the headerinclude directly. This meant less queries, and also less headache for users - no more template edits, it just works.

[/rant]

@mastermunj,
I sincerely apologize for hijacking your thread. I made the font smaller, though... Toungue

To get back on topic, maybe you're interested in some warnings I seem to be getting from your plugin.

On a thread page:
    The following warnings occurred:                                          
    Warning [2] arsort() expects parameter 1 to be array, string given -      
    Line: 486 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 486  arsort                             
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] array_sum() expects parameter 1 to be array, string given -   
    Line: 488 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 488  array_sum                          
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] Division by zero - Line: 489 - File:                          
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    /inc/plugins/master_meta_tags.php 489  errorHandler->error                
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] Invalid argument supplied for foreach() - Line: 492 - File:   
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    /inc/plugins/master_meta_tags.php 492  errorHandler->error                
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] array_keys() expects parameter 1 to be array, string given -  
    Line: 389 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 389  array_keys                         
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] shuffle() expects parameter 1 to be array, null given -       
    Line: 392 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 392  shuffle                            
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] array_slice() expects parameter 1 to be array, null given -   
    Line: 393 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 393  array_slice                        
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       
                                                                              
    Warning [2] implode(): Invalid arguments passed - Line: 394 - File:       
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 394  implode                            
    /inc/plugins/master_meta_tags.php 193  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /showthread.php                   22   require_once                       

Similar issue on a forum that contains no threads:
    The following warnings occurred:                                          
    Warning [2] arsort() expects parameter 1 to be array, string given -      
    Line: 486 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 486  arsort                             
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] array_sum() expects parameter 1 to be array, string given -   
    Line: 488 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 488  array_sum                          
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] Division by zero - Line: 489 - File:                          
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    /inc/plugins/master_meta_tags.php 489  errorHandler->error                
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] Invalid argument supplied for foreach() - Line: 492 - File:   
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    /inc/plugins/master_meta_tags.php 492  errorHandler->error                
    /inc/plugins/master_meta_tags.php 388  get_content_density                
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] array_keys() expects parameter 1 to be array, string given -  
    Line: 389 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 389  array_keys                         
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] shuffle() expects parameter 1 to be array, null given -       
    Line: 392 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 392  shuffle                            
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] array_slice() expects parameter 1 to be array, null given -   
    Line: 393 - File: inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo   
    (Linux)                                                                   
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 393  array_slice                        
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       
                                                                              
    Warning [2] implode(): Invalid arguments passed - Line: 394 - File:       
    inc/plugins/master_meta_tags.php PHP 5.3.3-pl0-gentoo (Linux)             
                                                                              
    File                              Line Function                           
    [PHP]                                  errorHandler->error                
    /inc/plugins/master_meta_tags.php 394  implode                            
    /inc/plugins/master_meta_tags.php 246  get_keywords                       
    [PHP]                                  master_meta_tags_global            
    /inc/class_plugins.php            101  call_user_func_array               
    /global.php                       95   pluginSystem->run_hooks            
    /forumdisplay.php                 21   require_once                       

The same warnings are displayed when actually writing a new thread in this empty forum. Your plugin actually just checks for fid/tid in $mybb->input so it does a description for newpost.php?fid=3 too. You should check THIS_SCRIPT that it's actually on a forum page and not something else entirely, otherwise your plugin is doing work for naught.
@frostschutz
Thanks for letting know the warnings. I've made some modifications and uploaded the new file for validation.
this plugin doesn't support ąęłńóżź and other diacritics.

is there any way to make them work?

many thanks,
bart

Invalid Download

The download you are attempting to view appears to be invalid.
Pages: 1 2