78% wp-g2a-goldmine-cd-keys-affiliate

Code Review | WP G2A Goldmine CD Keys Affiliate

WordPress plugin WP G2A Goldmine CD Keys Affiliate scored78%from 54 tests.

About plugin

  • Plugin page: wp-g2a-goldmine-c...
  • Plugin version: 0.7.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Mar 8, 2017
  • Latest release: Aug 30, 2020
  • Number of updates: 29
  • Update frequency: every 43.6 days
  • Top authors: hwk-fr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,801 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.53MB] [CPU: ▲3.04ms] Passed 4 tests

Analyzing server-side resources used by WP G2A Goldmine CD Keys Affiliate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5649.25 ▲0.99
Dashboard /wp-admin3.87 ▲0.5653.94 ▲0.07
Posts /wp-admin/edit.php3.92 ▲0.5677.26 ▲19.46
Add New Post /wp-admin/post-new.php6.38 ▲0.50116.64 ▲6.61
Media Library /wp-admin/upload.php3.73 ▲0.5041.86 ▲4.50

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
wpggma_RewriteBaseSlug
db_upgraded
wpggma_RewriteGameSlug
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP G2A Goldmine CD Keys Affiliate
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲3914.28 ▼0.101.80 ▼0.3244.84 ▼3.17
Dashboard /wp-admin2,228 ▲515.56 ▼0.1191.24 ▼3.5844.94 ▲4.80
Posts /wp-admin/edit.php2,134 ▲341.98 ▼0.0040.11 ▼4.1639.66 ▼1.04
Add New Post /wp-admin/post-new.php1,556 ▲3023.62 ▲0.56654.76 ▲50.7653.18 ▲7.33
Media Library /wp-admin/upload.php1,436 ▲364.36 ▲0.10137.10 ▲37.2655.28 ▲12.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • wpggma_RewriteGameSlug
    • wpggma_RewriteBaseSlug
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-g2a-goldmine-cd-keys-affiliate/wp-g2a-goldmine.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-g2a-goldmine-cd-keys-affiliate/inc/functions.php:233
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-g2a-goldmine-cd-keys-affiliate/inc/hooks.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-g2a-goldmine-cd-keys-affiliate/inc/post-types.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-g2a-goldmine-cd-keys-affiliate/inc/ajax.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: gaming, affiliation, games, affiliate, goldmine...

wp-g2a-goldmine-cd-keys-affiliate/wp-g2a-goldmine.php 85% from 13 tests

The main file in "WP G2A Goldmine CD Keys Affiliate" v. 0.7.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-g2a-goldmine-cd-keys-affiliate.php" instead of "wp-g2a-goldmine.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin11,414 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS2422988,155
PHP126255682,920
JavaScript28626339

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity54.00
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods125
▷ Static methods3931.20%
▷ Public methods10483.20%
▷ Protected methods1612.80%
▷ Private methods54.00%
Functions36
▷ Named functions3597.22%
▷ Anonymous functions12.78%
Constants61
▷ Global constants2236.07%
▷ Class constants3963.93%
▷ Public constants39100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/g2a.png8.26KB5.24KB▼ 36.50%