10% global-custom-fields

Code Review | Global Custom Fields

WordPress plugin Global Custom Fields scored 10% from 54 tests.

About plugin

  • Plugin page: global-custom-fields
  • Plugin version: 1.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Mar 24, 2021
  • Number of updates: 11
  • Update frequency: every 30.6 days
  • Top authors: tommasomeli (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active / 1,339 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/global-custom-fields/GCF.php+16
    Trying to access array offset on value of type bool

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

An overview of server-side resources used by Global Custom Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.51 ▼13.86
Dashboard /wp-admin3.32 ▲0.0144.60 ▼4.67
Posts /wp-admin/edit.php3.37 ▲0.0149.22 ▼1.63
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.27 ▼17.09
Media Library /wp-admin/upload.php3.24 ▲0.0134.38 ▲0.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
gcf_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Global Custom Fields
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲18213.95 ▼0.428.56 ▲6.7537.89 ▲1.31
Dashboard /wp-admin2,220 ▲325.82 ▼0.06110.21 ▼7.9639.72 ▼6.24
Posts /wp-admin/edit.php2,109 ▲202.06 ▲0.0041.35 ▲1.6935.50 ▼0.15
Add New Post /wp-admin/post-new.php1,532 ▲1323.25 ▲0.25667.04 ▲3.9963.13 ▲12.25
Media Library /wp-admin/upload.php1,411 ▲294.14 ▼0.03101.96 ▲3.1342.89 ▼0.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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 take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/global-custom-fields/views/GlobalCF.php on line 4
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/global-custom-fields/views/Fields.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/global-custom-fields/views/Settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/global-custom-fields/views/GlobalCF.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/global-custom-fields/GCF.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/global-custom-fields/views/Fields.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: advanced, field, fields, global custom fields, gcf...

global-custom-fields/GCF.php 92% from 13 tests

The main PHP file in "Global Custom Fields" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("global-custom-fields.php" instead of "GCF.php")

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
Good job! No executable or dangerous file extensions detected519 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP74188341
CSS123098
JavaScript18980

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods888.89%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants1
▷ Global constants1100.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
No PNG files were detected