73% gist-button

Code Review | Gist Button

WordPress plugin Gist Button scored73%from 54 tests.

About plugin

  • Plugin page: gist-button
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 1.5-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2015
  • Latest release: Oct 29, 2015
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: gistbutton (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /936 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.90ms] Passed 4 tests

This is a short check of server-side resources used by Gist Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0349.60 ▲9.64
Dashboard /wp-admin3.34 ▲0.0347.95 ▼3.53
Posts /wp-admin/edit.php3.39 ▲0.0351.17 ▲3.64
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.54 ▼10.56
Media Library /wp-admin/upload.php3.26 ▲0.0340.39 ▲6.86

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: 1 new table, 6 new options
New tables
wp_gistbutton_options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gist Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.72 ▲0.211.82 ▲0.0845.75 ▲1.34
Dashboard /wp-admin2,209 ▲325.61 ▼0.0588.47 ▼26.8441.40 ▼3.94
Posts /wp-admin/edit.php2,120 ▲202.03 ▲0.0137.61 ▲0.2336.40 ▼1.71
Add New Post /wp-admin/post-new.php1,543 ▲823.18 ▲5.02678.73 ▲53.0953.54 ▼6.58
Media Library /wp-admin/upload.php1,420 ▲264.17 ▲0.01113.28 ▲13.1448.76 ▲5.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_gistbutton_options
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/gist-button/admin/active.php:4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/gist-button/admin/body.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/gist-button/admin/body.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gist-button/wp-gistbutton.php:11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/gist-button/admin/active.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/gist-button/admin/body.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/gist-button/admin/body.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Selection of theme for Gist Button.), #2 (Selection of features for the Gist Button), #3 (Login screen for validating plugin.), #4 (Screen when the Gist Button plugin is active.), #5 (Gist content of blog post in overlay), #6 (Gist button on page bottom-left.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

gist-button/wp-gistbutton.php 92% from 13 tests

Analyzing the main PHP file in "Gist Button" version 1.0.1
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gist-button.php" instead of "wp-gistbutton.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,224 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS11711717
PHP44112290
JavaScript1183217

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 1.44MB with 0.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png29.17KB8.14KB▼ 72.08%
assets/screenshot-4.png39.59KB12.12KB▼ 69.39%
img/smallthumb.png0.41KB0.44KB0.00%
images/option_1.png12.30KB5.44KB▼ 55.74%
assets/screenshot-6.png240.84KB64.98KB▼ 73.02%