83% moodgiver-custom-tabs-fields-for-woocommerce

Code Review | Custom Tabs & Fields for Woocommerce

WordPress plugin Custom Tabs & Fields for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: moodgiver-custom-...
  • Plugin version: 0.2a...
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2017
  • Latest release: Nov 13, 2018
  • Number of updates: 12
  • Update frequency: every 27.9 days
  • Top authors: swinaallen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /781 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.39MB] [CPU: ▼31.23ms] Passed 4 tests

Server-side resources used by Custom Tabs & Fields for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.257.27 ▼34.76
Dashboard /wp-admin3.24 ▼0.1030.44 ▼35.21
Posts /wp-admin/edit.php3.38 ▲0.0334.34 ▼23.90
Add New Post /wp-admin/post-new.php5.63 ▼0.2671.76 ▼31.05
Media Library /wp-admin/upload.php3.33 ▲0.1029.60 ▼12.71
DB Optimize /wp-admin/admin.php?page=menu-posts-mg_wc_db_optimize3.2327.66
Moodgiver Custom Tabs & Fields /wp-admin/admin.php?page=mg_wc_ctcf3.2328.42
Custom Fields /wp-admin/admin.php?page=menu-posts-mg_wc_custom_fields3.2327.75
Custom Tabs /wp-admin/edit.php?post_type=mg_wc_tab3.3633.70
CSV Data Sample /wp-admin/admin.php?page=menu-posts-mg_wc_csv_sample3.2327.18

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Tabs & Fields for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲10813.39 ▼0.991.53 ▼0.1241.60 ▲2.42
Dashboard /wp-admin2,256 ▲715.01 ▼0.80113.03 ▼4.5242.58 ▼5.28
Posts /wp-admin/edit.php2,146 ▲542.52 ▲0.4740.09 ▲4.0135.37 ▼2.23
Add New Post /wp-admin/post-new.php1,555 ▲1323.18 ▲4.80668.31 ▼44.3959.89 ▼5.02
Media Library /wp-admin/upload.php1,435 ▲474.42 ▲0.20100.03 ▼12.2842.59 ▼3.78
DB Optimize /wp-admin/admin.php?page=menu-posts-mg_wc_db_optimize8401.9931.5628.29
Moodgiver Custom Tabs & Fields /wp-admin/admin.php?page=mg_wc_ctcf9431.9030.6234.59
Custom Fields /wp-admin/admin.php?page=menu-posts-mg_wc_custom_fields9462.1035.4830.29
Custom Tabs /wp-admin/edit.php?post_type=mg_wc_tab1,1312.2734.7729.21
CSV Data Sample /wp-admin/admin.php?page=menu-posts-mg_wc_csv_sample8511.9828.1029.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=menu-posts-mg_wc_csv_sample
    • > Warning in wp-content/plugins/moodgiver-custom-tabs-fields-for-woocommerce/main.php+48
    Use of undefined constant jQuery - assumed 'jQuery' (this will throw an Error in a future version of PHP)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=menu-posts-mg_wc_csv_sample
    • > Warning in wp-content/plugins/moodgiver-custom-tabs-fields-for-woocommerce/main.php+48
    Use of undefined constant ui - assumed 'ui' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=menu-posts-mg_wc_db_optimize
    • > Notice in wp-content/plugins/moodgiver-custom-tabs-fields-for-woocommerce/admin/moodgiver-ctcf-admin-custom-fields.php+210
    Undefined index: run_db_optimize
    • > GET request to /wp-admin/admin.php?page=menu-posts-mg_wc_db_optimize
    • > Notice in wp-content/plugins/moodgiver-custom-tabs-fields-for-woocommerce/admin/moodgiver-ctcf-admin-custom-fields.php+226
    Undefined variable: current
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=menu-posts-mg_wc_db_optimize
    • > Notice in wp-content/plugins/moodgiver-custom-tabs-fields-for-woocommerce/admin/moodgiver-ctcf-admin-custom-fields.php+230
    Undefined variable: optimize

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: custom fields, product custom tabs, product custom fields, woocommerce, custom tabs

moodgiver-custom-tabs-fields-for-woocommerce/main.php 77% from 13 tests

The main PHP file in "Custom Tabs & Fields for Woocommerce" ver. 0.2a... adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 329 characters long)
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "0.2a...")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("moodgiver-custom-tabs-fields-for-woocommerce.php" instead of "main.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
There were no executable files found in this plugin4,300 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript45942161,679
PHP612887925
CSS51916797
JSON100391
SVG100288
PO File18396220

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 1.48MB with 1.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png168.04KB47.93KB▼ 71.48%
assets/screenshot-4.png124.22KB35.42KB▼ 71.48%
assets/screenshot-2.png87.01KB27.90KB▼ 67.93%
assets/screenshot-6.png219.96KB66.59KB▼ 69.73%
assets/screenshot-1.png544.44KB175.35KB▼ 67.79%