84% wc-fields-factory

Code Review | WC Fields Factory

WordPress plugin WC Fields Factory scored84%from 54 tests.

About plugin

  • Plugin page: wc-fields-factory
  • Plugin version: 4.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 22, 2015
  • Latest release: Nov 13, 2023
  • Number of updates: 142
  • Update frequency: every 22.2 days
  • Top authors: mycholan (81.69%)sarkparanjothi (19.01%)

Code review

54 tests

User reviews

165 reviews

Install metrics

10,000+ active /268,280 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼9.88ms] Passed 4 tests

A check of server-side resources used by WC Fields Factory
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1939.24 ▼2.47
Dashboard /wp-admin3.50 ▲0.1546.22 ▼22.00
Posts /wp-admin/edit.php3.61 ▲0.2550.71 ▲0.07
Add New Post /wp-admin/post-new.php6.08 ▲0.1992.56 ▼15.12
Media Library /wp-admin/upload.php3.42 ▲0.1937.42 ▲0.73

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 94 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

WC Fields Factory: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.37 ▲0.021.78 ▼0.0237.98 ▼7.26
Dashboard /wp-admin2,204 ▲325.62 ▼0.2290.37 ▼27.3438.00 ▼9.63
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0442.03 ▲5.5336.60 ▼0.60
Add New Post /wp-admin/post-new.php1,532 ▲622.83 ▼0.30646.43 ▼19.4852.42 ▼0.38
Media Library /wp-admin/upload.php1,403 ▲64.22 ▼0.0298.13 ▼5.8041.71 ▼2.14

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • wcff_options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 items
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-fields-factory/views/meta_box_option.php:7
    • > PHP Notice
      Trying to get property 'roles' of non-object in wp-content/plugins/wc-fields-factory/views/meta_box_group_preference.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wc-fields-factory/includes/wcff_post_list_table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wc-fields-factory/includes/wcff_post_list_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wc-fields-factory/includes/wcff_options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wc-fields-factory/includes/meta/wcff-common-wccaf-meta.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wc-fields-factory/views/meta_box_group_preference.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wc-fields-factory/includes/meta/wcff-common-meta.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wc-fields-factory/views/meta_box_group_preference.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wc-fields-factory/includes/meta/wcff-meta.php:6

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 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
Attributes that require attention: You can take inspiration from this readme.txt

wc-fields-factory/wcff.php 92% from 13 tests

The entry point to "WC Fields Factory" version 4.1.8 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-fields-factory.php" instead of "wcff.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin25,429 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP371,9952,80711,859
JavaScript91,4911,2029,577
CSS5621853,993

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity105.87
▷ Minimum class complexity1.00
▷ Maximum class complexity502.00
Average method complexity8.12
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods339
▷ Static methods00.00%
▷ Public methods22967.55%
▷ Protected methods00.00%
▷ Private methods11032.45%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.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
38 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/wccpf.png0.19KB0.14KB▼ 27.18%
assets/img/select.png0.48KB0.27KB▼ 42.92%
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/img/prev.png10.45KB1.78KB▼ 82.97%
assets/img/search-icon.png4.80KB0.76KB▼ 84.15%