52% code-generator-lite

Code Review | Code Generator Lite

WordPress plugin Code Generator Lite scored52%from 54 tests.

About plugin

  • Plugin page: code-generator-lite
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Jan 6, 2013
  • Latest release: Jan 8, 2013
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: DKN (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,221 total downloads

Benchmarks

Plugin footprint 48% 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.82MB] [CPU: ▼37.49ms] Passed 4 tests

An overview of server-side resources used by Code Generator Lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1436.58 ▼4.37
Dashboard /wp-admin3.13 ▼0.2123.40 ▼40.64
Posts /wp-admin/edit.php3.13 ▼0.2224.57 ▼22.44
Add New Post /wp-admin/post-new.php3.13 ▼2.7524.03 ▼76.78
Media Library /wp-admin/upload.php3.13 ▼0.1021.97 ▼10.11
Add Code /wp-admin/admin.php?page=code_generator_lite_add_code3.1323.50
Create Generator /wp-admin/admin.php?page=code_generator_lite_create_generator3.1322.28
/wp-admin/admin.php?page=code_generator_lite_style3.1323.12
Code Generator Lite /wp-admin/admin.php?page=code_generator_lite_generator3.1325.18
/wp-admin/admin.php?page=code_generator_lite_edit_code3.1324.72
/wp-admin/admin.php?page=code_generator_lite_edit_generator3.1324.31

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: 1 new table, 7 new options
New tables
wp_code_generator_lite
New WordPress options
code_generator_lite_db_version
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Code Generator Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲7813.24 ▼1.141.71 ▼0.3241.27 ▼3.75
Dashboard /wp-admin2,252 ▲615.84 ▲0.97104.67 ▲3.0142.56 ▼1.88
Posts /wp-admin/edit.php2,144 ▲582.03 ▲0.0440.19 ▲2.6142.48 ▲6.82
Add New Post /wp-admin/post-new.php1,413 ▼10822.74 ▼0.41560.79 ▼67.1859.01 ▲6.22
Media Library /wp-admin/upload.php1,440 ▲524.23 ▼0.0096.68 ▼9.6643.74 ▼1.49
Add Code /wp-admin/admin.php?page=code_generator_lite_add_code8992.0232.2343.78
Create Generator /wp-admin/admin.php?page=code_generator_lite_create_generator8492.0224.4330.83
/wp-admin/admin.php?page=code_generator_lite_style8302.0222.2432.66
Code Generator Lite /wp-admin/admin.php?page=code_generator_lite_generator9032.0223.0338.89
/wp-admin/admin.php?page=code_generator_lite_edit_code8982.0222.9033.65
/wp-admin/admin.php?page=code_generator_lite_edit_generator8442.0223.3532.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > 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 1 table in the database
    • wp_code_generator_lite
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • code_generator_lite_db_version
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 90 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_generator
    • > 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.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+856
    Undefined variable: code_generator_lite_installed_ver
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_add_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+363
    Undefined variable: code_generator_lite_add_code_get_value
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_add_code
    • > Warning in wp-content/plugins/code-generator-lite/generator.php+363
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_style
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+345
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_style
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+347
    Undefined variable: code_generator_lite_style_content
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+23
    Undefined variable: code_generator_lite_db_version
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+315
    Trying to get property 'value' of non-object
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+239
    Undefined variable: code_generator_lite_list_info_value
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+659
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+447
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+448
    Undefined index: del
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+449
    Undefined index: code_generator_lite_edit_code_code
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+450
    Undefined index: code_generator_lite_edit_code_password
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+451
    Undefined index: code_generator_lite_edit_code_url
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+452
    Undefined index: code_generator_lite_edit_code_url_two
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+453
    Undefined index: code_generator_lite_edit_code_url_three
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_code
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+659
    Undefined variable: code_generator_lite_edit_code_get_values
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+294
    Undefined index: code_generator_lite_edit_generator_name
    • > GET request to /wp-admin/admin.php?page=code_generator_lite_edit_generator
    • > Notice in wp-content/plugins/code-generator-lite/generator.php+315
    Undefined variable: code_generator_lite_edit_generator_generator

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/code-generator-lite/style.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/code-generator-lite/style.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/code-generator-lite/generator.php:729
    • > PHP Notice
      Undefined variable: code_generator_lite_display_url in wp-content/plugins/code-generator-lite/style.php on line 3
    • > PHP Notice
      Undefined variable: code_generator_lite_display_get_code_values in wp-content/plugins/code-generator-lite/style.php on line 2
    • > PHP Notice
      Undefined variable: code_generator_lite_generate_get_code in wp-content/plugins/code-generator-lite/style.php on line 9
    • > PHP Notice
      Trying to get property 'value' of non-object in wp-content/plugins/code-generator-lite/style.php on line 9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Generator Display.), #2 (Generator and Codes.)
The official readme.txt is a good inspiration

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

The principal PHP file in "Code Generator Lite" v. 1.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("code-generator-lite.php" instead of "generator.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
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

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png3.80KB2.13KB▼ 43.93%
screenshot-2.png33.58KB14.83KB▼ 55.84%