10% google-page-badge

Code Review | Google+ Page Badge

WordPress plugin Google+ Page Badge scored10%from 54 tests.

About plugin

  • Plugin page: google-page-badge
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2012
  • Latest release: Feb 2, 2012
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: bkmacdaddy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,450 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/google-page-badge/google-plus-page-badge.php+70
    Methods with the same name as their class will not be constructors in a future version of PHP; gPlusPageBadge_Widget has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼49.33ms] Passed 4 tests

Server-side resources used by Google+ Page Badge
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.87 ▼34.23
Dashboard /wp-admin2.11 ▼1.205.24 ▼42.42
Posts /wp-admin/edit.php2.11 ▼1.256.53 ▼39.20
Add New Post /wp-admin/post-new.php2.11 ▼3.785.73 ▼81.47
Media Library /wp-admin/upload.php2.11 ▼1.125.85 ▼29.31
Google+ Page Badge /wp-admin/options-general.php?page=plugin2.115.63

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_gpluspagebadge_widget
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Google+ Page Badge
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.30 ▼0.0726.89 ▲25.2240.13 ▼6.35
Dashboard /wp-admin2,210 ▲224.85 ▲0.03106.72 ▼8.9438.89 ▼8.96
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0442.25 ▲5.9537.15 ▲2.60
Add New Post /wp-admin/post-new.php1,536 ▲323.47 ▲0.14592.22 ▼93.3546.02 ▼5.62
Media Library /wp-admin/upload.php1,395 ▲44.16 ▼0.0697.04 ▼6.1141.79 ▼2.92
Google+ Page Badge /wp-admin/options-general.php?page=plugin8272.0228.2427.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/google-page-badge/google-plus-page-badge.php+70
    Methods with the same name as their class will not be constructors in a future version of PHP; gPlusPageBadge_Widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_gpluspagebadge_widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=plugin
    • > Deprecated in wp-content/plugins/google-page-badge/google-plus-page-badge.php+70
    Methods with the same name as their class will not be constructors in a future version of PHP; gPlusPageBadge_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=plugin
    • > Deprecated in wp-content/plugins/google-page-badge/google-plus-page-badge.php+135
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in gPlusPageBadge_Widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'gpluspb_create_menu' not found or invalid function name
    • > GET request to /wp-admin/options-general.php?page=plugin
    • > Notice in wp-content/plugins/google-page-badge/google-plus-page-badge.php+150
    Undefined index: gpluspb_hidden

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/google-page-badge/google-plus-page-badge.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The plugin settings page), #2 (The widget settings), #3 (Badge that is displayed when "smallbadge" is the chosen size), #4 (Default badge that is displayed when size is not selected)
You can look at the official readme.txt

google-page-badge/google-plus-page-badge.php 85% from 13 tests

Analyzing the main PHP file in "Google+ Page Badge" version 1.0
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 311 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("google-page-badge.php" instead of "google-plus-page-badge.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin136 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14329136

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin