88% custom-variables

Code Review | Custom Variables

WordPress plugin Custom Variables scored 88% from 53 tests.

About plugin

  • Plugin page: custom-variables
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0
  • WordPress version: 5.8.1
  • First release: Jan 14, 2015
  • Latest release: Jan 14, 2015
  • Number of updates: 2
  • Update frequency: every 31.0 days
  • Top authors: lili0allen (100%)

Code review

53 tests

User reviews

1 review

Install metrics

100+ active / 1,303 total downloads

Benchmarks

Plugin footprint Passed 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 gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼278.56ms] Passed 4 tests

Analyzing server-side resources used by Custom Variables
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1340.30 ▲19.83
Dashboard /wp-admin3.08 ▲0.0247.20 ▼25.51
Posts /wp-admin/edit.php3.13 ▲0.0243.21 ▼2.53
Add New Post /wp-admin/post-new.php5.44 ▲0.0185.65 ▼1,077.35
Media Library /wp-admin/upload.php3.02 ▲0.0133.30 ▼8.84
Custom Variables /wp-admin/options-general.php?page=cvem_options2.9621.02

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Variables
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,658 ▲5215.89 ▲0.2210.94 ▲2.7548.10 ▲2.07
Dashboard /wp-admin2,936 ▲865.98 ▲0.08132.76 ▼13.4998.86 ▼7.38
Posts /wp-admin/edit.php2,712 ▲62.69 ▼0.0064.10 ▼8.0087.97 ▼3.05
Add New Post /wp-admin/post-new.php1,869 ▼16915.54 ▼3.90367.48 ▼1.31106.07 ▼3.58
Media Library /wp-admin/upload.php1,784 ▲125.03 ▲0.01143.54 ▼18.79107.39 ▼11.87
Custom Variables /wp-admin/options-general.php?page=cvem_options1,0922.3556.2056.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% 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
    • > GET request to /wp-admin/options-general.php?page=cvem_options
    • > Notice in wp-content/plugins/custom-variables/includes/setting.php+72
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=cvem_options
    • > Warning in wp-content/plugins/custom-variables/includes/setting.php+72
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-variables/includes/setting.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-variables/includes/scripts.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/custom-variables/includes/display-functions.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-variables/custom-variables.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Plugin setting page)
You can look at the official readme.txt

custom-variables/custom-variables.php 92% from 13 tests

The principal PHP file in "Custom Variables" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 440 characters long)

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
Everything looks great! No dangerous files found in this plugin151 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP54818125
JavaScript14020
CSS1006

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin