68% toolazy-custom-fields

Code Review | Toolazy Custom Fields

WordPress plugin Toolazy Custom Fields scored68%from 54 tests.

About plugin

  • Plugin page: toolazy-custom-fi...
  • Plugin version: 0.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.1
  • WordPress version: 6.3.1
  • First release: Apr 27, 2021
  • Latest release: Oct 15, 2021
  • Number of updates: 11
  • Update frequency: every 15.6 days
  • Top authors: viet27th (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /391 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.75ms] Passed 4 tests

Analyzing server-side resources used by Toolazy Custom Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3043.31 ▲0.87
Dashboard /wp-admin3.41 ▲0.1150.22 ▼4.58
Posts /wp-admin/edit.php3.53 ▲0.1753.10 ▲6.79
Add New Post /wp-admin/post-new.php6.03 ▲0.1490.09 ▼19.99
Media Library /wp-admin/upload.php3.34 ▲0.1136.94 ▲0.72
Introduce /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/introduce.view.php3.3035.55
Setting /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/setting.view.php3.3034.48

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 70 new files
Database: 1 new table, 7 new options
New tables
wp_tcf_custom_fields
New WordPress options
can_compress_scripts
widget_recent-comments
tcf_db_version
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Toolazy Custom Fields
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.35 ▼0.011.65 ▼0.0143.46 ▲0.43
Dashboard /wp-admin2,225 ▲485.63 ▲0.1190.22 ▼0.6541.25 ▲1.49
Posts /wp-admin/edit.php2,127 ▲272.03 ▲0.0838.85 ▼0.8238.35 ▲2.17
Add New Post /wp-admin/post-new.php1,554 ▲2823.71 ▲0.73654.96 ▼67.1155.12 ▼22.66
Media Library /wp-admin/upload.php1,427 ▲334.29 ▲0.0699.25 ▼12.8943.53 ▼5.06
Introduce /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/introduce.view.php8742.3238.2227.10
Setting /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/setting.view.php8312.5345.4627.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_tcf_custom_fields
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • tcf_db_version
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 fix the following
  • 20× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/toolazy-custom-fields/migration/TCF-Migration.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/toolazy-custom-fields/migration/TCF-Migration.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/toolazy-custom-fields/custom-field-layouts/input.layout.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/toolazy-custom-fields/custom-field-layouts/textarea.layout.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/toolazy-custom-fields/migration/TCF-Migration.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toolazy-custom-fields/api/TCF-Common.api.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/toolazy-custom-fields/custom-field-layouts/checkbox.layout.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/toolazy-custom-fields/menu-views/introduce.view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toolazy-custom-fields/api/TCF-Common.api.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/toolazy-custom-fields/custom-field-layouts/file.layout.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/setting.view.php
    • > Network (severe)
    wp-json/tcf/v1/check-plugin-active - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/setting.view.php
    • > Network (severe)
    wp-json/tcf/v1/get-custom-field-types - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=toolazy-custom-fields/menu-views/setting.view.php
    • > Network (severe)
    wp-json/tcf/v1/get-post-types - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

toolazy-custom-fields/toolazy-cf.php 92% from 13 tests

The primary PHP file in "Toolazy Custom Fields" version 0.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("toolazy-custom-fields.php" instead of "toolazy-cf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected12,752 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JSON2009,010
JavaScript272002701,863
PHP192623241,345
Sass56413451
Markdown212064
CSS13019

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods35
▷ Static methods1748.57%
▷ Public methods35100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions16.67%
▷ Anonymous functions1493.33%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.56MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/file.png2.09KB1.56KB▼ 25.12%
assets/screenshot-2.png279.14KB74.44KB▼ 73.33%
assets/icon-128x128.png5.30KB3.17KB▼ 40.13%
assets/screenshot-1.png211.94KB53.76KB▼ 74.63%
assets/banner-772x250.png53.13KB13.19KB▼ 75.17%