84% gamipress-button

Code Review | GamiPress - Button

WordPress plugin GamiPress - Button scored84%from 54 tests.

About plugin

  • Plugin page: gamipress-button
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Dec 5, 2019
  • Latest release: Oct 17, 2023
  • Number of updates: 24
  • Update frequency: every 58.9 days
  • Top authors: rubengc (95.83%)dioni00 (8.33%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /11,949 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.19ms] Passed 4 tests

An overview of server-side resources used by GamiPress - Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0233.86 ▼5.24
Dashboard /wp-admin3.33 ▼0.0245.01 ▼15.86
Posts /wp-admin/edit.php3.38 ▲0.0246.81 ▼2.66
Add New Post /wp-admin/post-new.php5.91 ▲0.0278.84 ▼16.99
Media Library /wp-admin/upload.php3.25 ▲0.0236.35 ▲3.69

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for GamiPress - Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3514.25 ▼0.201.57 ▼0.3140.84 ▼3.75
Dashboard /wp-admin2,212 ▲385.63 ▲0.0590.84 ▲4.0438.45 ▼0.77
Posts /wp-admin/edit.php2,118 ▲181.97 ▼0.0540.60 ▲2.9336.70 ▲6.05
Add New Post /wp-admin/post-new.php1,540 ▲1423.03 ▲0.01674.31 ▲3.7649.55 ▼15.14
Media Library /wp-admin/upload.php1,417 ▲174.18 ▼0.0195.13 ▼8.7743.22 ▼1.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • 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 | 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gamipress-button/gamipress-button.php:205

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

gamipress-button/gamipress-button.php Passed 13 tests

The principal PHP file in "GamiPress - Button" v. 1.0.6 is loaded by WordPress automatically on each request
77 characters long description:
Add activity triggers based on button clicks generated by [gamipress_button].

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected660 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10172391540
JavaScript43910120

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods9
▷ Static methods111.11%
▷ Public methods555.56%
▷ Protected methods00.00%
▷ Private methods444.44%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin