52% code-generator-pro

Code Review | Code Generator Pro

WordPress plugin Code Generator Pro scored52%from 54 tests.

About plugin

  • Plugin page: code-generator-pro
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: May 16, 2013
  • Latest release: May 16, 2013
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: DKN (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,318 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.94MB] [CPU: ▼31.14ms] Passed 4 tests

This is a short check of server-side resources used by Code Generator Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.26 ▼3.14
Dashboard /wp-admin3.00 ▼0.3029.93 ▼21.35
Posts /wp-admin/edit.php3.00 ▼0.3625.79 ▼15.65
Add New Post /wp-admin/post-new.php3.00 ▼2.8924.59 ▼79.96
Media Library /wp-admin/upload.php3.00 ▼0.2325.09 ▼7.58
/wp-admin/admin.php?page=code_generator_edit_code3.0026.04
/wp-admin/admin.php?page=code_generator_edit_generator3.0022.89
Create Generator /wp-admin/admin.php?page=code_generator_create_generator3.0024.34
Code Generator /wp-admin/admin.php?page=code_generator_generators3.0026.74
Add Code /wp-admin/admin.php?page=code_generator_add_code3.0024.33
Codes /wp-admin/admin.php?page=code_generator_codes3.0024.09
/wp-admin/admin.php?page=code_generator_style3.0024.75

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: 3 new tables, 7 new options
New tables
wp_code_generator_codes
wp_code_generator_code_urls
wp_code_generator_generators
New WordPress options
theysaidso_admin_options
widget_recent-comments
code_generator_db_version
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Code Generator Pro
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲12313.74 ▼0.641.73 ▼0.0744.90 ▲0.16
Dashboard /wp-admin2,278 ▲864.83 ▼0.09106.99 ▼0.8645.56 ▲3.40
Posts /wp-admin/edit.php2,164 ▲752.00 ▲0.0335.23 ▼9.6342.42 ▲5.95
Add New Post /wp-admin/post-new.php1,422 ▼9520.70 ▲3.10570.82 ▼61.0658.06 ▲6.03
Media Library /wp-admin/upload.php1,454 ▲664.23 ▼0.0993.46 ▼1.9344.91 ▲5.02
/wp-admin/admin.php?page=code_generator_edit_code9172.0222.1835.30
/wp-admin/admin.php?page=code_generator_edit_generator8642.0224.2436.24
Create Generator /wp-admin/admin.php?page=code_generator_create_generator8692.0224.8531.82
Code Generator /wp-admin/admin.php?page=code_generator_generators9012.0221.9634.05
Add Code /wp-admin/admin.php?page=code_generator_add_code9302.0224.5837.49
Codes /wp-admin/admin.php?page=code_generator_codes8622.0222.7932.47
/wp-admin/admin.php?page=code_generator_style8502.0225.2330.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_code_generator_generators
    • wp_code_generator_codes
    • wp_code_generator_code_urls
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • code_generator_db_version
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 119 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_style
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_style
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+170
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+298
    Undefined index: code_generator_edit_code
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+299
    Undefined index: code_generator_edit_code_password
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+300
    Undefined index: code_generator_edit_code_url
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+301
    Undefined index: code_generator_edit_code_new_url
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+302
    Undefined index: code_generator_edit_code_parent_id
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+303
    Undefined index: del
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+304
    Undefined index: del_url
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+392
    Undefined variable: code_generator_edit_code_get_code
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+388
    Trying to get property 'code' of non-object
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+392
    Trying to get property 'password' of non-object
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+394
    Undefined variable: code_generator_edit_code_get_url
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_code
    • > Warning in wp-content/plugins/code-generator-pro/generator.php+394
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_generator
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+123
    Undefined index: code_generator_edit_generator_name
    • > GET request to /wp-admin/admin.php?page=code_generator_edit_generator
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+155
    Undefined variable: code_generator_edit_generator_generator
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_style
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+186
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=code_generator_codes
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+458
    Undefined variable: code_generator_codes_name
    • > GET request to /wp-admin/admin.php?page=code_generator_style
    • > Notice in wp-content/plugins/code-generator-pro/generator.php+188
    Undefined variable: code_generator_style_content

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/code-generator-pro/style.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/code-generator-pro/style.php on line 3
    • > PHP Notice
      Undefined variable: code_generator_generate_code in wp-content/plugins/code-generator-pro/style.php on line 9
    • > PHP Notice
      Undefined variable: code_generator_display_num_codes in wp-content/plugins/code-generator-pro/style.php on line 3
    • > PHP Notice
      Undefined variable: code_generator_display_codes_generator_name in wp-content/plugins/code-generator-pro/style.php on line 2
    • > PHP Notice
      Undefined variable: code_generator_display_url in wp-content/plugins/code-generator-pro/style.php on line 3
    • > PHP Notice
      Undefined variable: code_generator_display_codes_generator_id in wp-content/plugins/code-generator-pro/style.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/code-generator-pro/generator.php:522
    • > PHP Notice
      Trying to get property 'code' of non-object in wp-content/plugins/code-generator-pro/style.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Generator Display.), #2 (Generator.), #3 (Generator Codes.)
You can take inspiration from this readme.txt

code-generator-pro/generator.php 92% from 13 tests

Analyzing the main PHP file in "Code Generator Pro" version 1.2
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("code-generator-pro.php" instead of "generator.php")

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
Good job! No executable or dangerous file extensions detected2 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for 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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png44.17KB20.50KB▼ 53.60%
screenshot-1.png21.57KB8.13KB▼ 62.30%
screenshot-3.png19.91KB9.02KB▼ 54.68%