10% wc-tabs-and-custom-fields

Code Review | WC Tabs and Custom Fields

WordPress plugin WC Tabs and Custom Fields scored10%from 54 tests.

About plugin

  • Plugin page: wc-tabs-and-custo...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.5.1
  • WordPress version: 6.3.1
  • First release: May 10, 2016
  • Latest release: May 10, 2016
  • Number of updates: 4
  • Update frequency: every 29.0 days
  • Top authors: Rustaurius (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /917 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5905
    Function map_meta_cap was called incorrectly. The post type wc_tab is not registered, so it may not be reliable to check the capability edit_post against a post of that type. Please see Debugging in WordPress for more information. (This message was added in version 4.4.0.)

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.40ms] Passed 4 tests

A check of server-side resources used by WC Tabs and Custom Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.19 ▲0.53
Dashboard /wp-admin3.35 ▲0.0551.73 ▼3.22
Posts /wp-admin/edit.php3.40 ▲0.0548.03 ▲0.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0588.74 ▼8.73
Media Library /wp-admin/upload.php3.27 ▲0.0435.10 ▼1.68
Tabs /wp-admin/edit.php?post_type=wc_tab3.3745.14
Custom Fields /wp-admin/edit.php?post_type=product&page=wctcf-custom-fields3.0424.28

Server storage [IO: ▲0.16MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • You have illegally modified 1 file (0.00KB) outside of "wp-content/plugins/wc-tabs-and-custom-fields/" and "wp-content/uploads/"
    • (new file) wp-admin/Error.txt
Filesystem: 24 new files
Database: no new tables, 9 new options
New WordPress options
EWD_WCTCF_Full_Version
db_upgraded
theysaidso_admin_options
plugin_error
EWD_WCTCF_Install_Flag
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WC Tabs and Custom Fields
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12113.40 ▼1.358.69 ▲6.8944.26 ▼2.00
Dashboard /wp-admin2,202 ▲255.64 ▼0.0187.27 ▼16.1141.70 ▼6.59
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0136.02 ▼2.1736.26 ▼0.04
Add New Post /wp-admin/post-new.php1,533 ▼2123.03 ▲4.94671.10 ▼26.7952.40 ▼3.12
Media Library /wp-admin/upload.php1,404 ▲104.25 ▼0.02100.16 ▼0.5446.06 ▲1.90
Tabs /wp-admin/edit.php?post_type=wc_tab1,8692.5747.2630.96
Custom Fields /wp-admin/edit.php?post_type=product&page=wctcf-custom-fields280.440.183.84

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 9 options in the database
    • can_compress_scripts
    • EWD_WCTCF_Install_Flag
    • plugin_error
    • widget_theysaidso_widget
    • EWD_WCTCF_Full_Version
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-tabs-and-custom-fields/html/AdminFooter.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-tabs-and-custom-fields/Functions/EWD_WCTCF_Process_Ajax.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-tabs-and-custom-fields/Functions/EWD_WCTCF_Add_Tabs_Columns.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-tabs-and-custom-fields/Functions/Register_EWD_WCTCF_Posts_Taxonomies.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-tabs-and-custom-fields/Functions/EWD_WCTCF_Add_WC_Admin_Product_Tabs.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-tabs-and-custom-fields/Functions/EWD_WCTCF_Save_Post_Meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-tabs-and-custom-fields/html/AdminCFHeader.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wc-tabs-and-custom-fields/html/CustomFieldDetailsPage.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-tabs-and-custom-fields/html/AdminTabHeader.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wc-tabs-and-custom-fields/html/CustomFieldsPage.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wc-tabs-and-custom-fields/Main.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=product&page=wctcf-custom-fields
    • > Network (severe)
    wp-admin/edit.php?post_type=product&page=wctcf-custom-fields - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: woocommerce tabs

wc-tabs-and-custom-fields/Main.php 85% from 13 tests

"WC Tabs and Custom Fields" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-tabs-and-custom-fields.php" instead of "Main.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin3,596 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33461971,910
PHP1719044999
CSS37442687

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
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%
Functions48
▷ Named functions48100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected