78% wp-centrico

Code Review | WP Centrico

WordPress plugin WP Centrico scored78%from 54 tests.

About plugin

  • Plugin page: wp-centrico
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 10, 2015
  • Latest release: Dec 23, 2022
  • Number of updates: 45
  • Update frequency: every 58.7 days
  • Top authors: ado2000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.52ms] Passed 4 tests

Server-side resources used by WP Centrico
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.96 ▲0.47
Dashboard /wp-admin3.37 ▲0.0744.04 ▼1.06
Posts /wp-admin/edit.php3.48 ▲0.1346.07 ▼6.02
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.37 ▼15.45
Media Library /wp-admin/upload.php3.29 ▲0.0637.47 ▲4.28
Woocommerce /wp-admin/admin.php?page=wp-centrico-woocommerce3.3233.27
Settings /wp-admin/admin.php?page=wp-centrico3.2733.76

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: 1 new table, 8 new options
New tables
wp_centrico
New WordPress options
recovery_mode_email_last_sent
theysaidso_admin_options
widget_centrico_widget
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

WP Centrico: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.16 ▼1.201.73 ▼0.0245.43 ▼0.29
Dashboard /wp-admin2,233 ▲455.85 ▼0.0698.96 ▼4.5039.19 ▼4.09
Posts /wp-admin/edit.php2,119 ▲302.17 ▲0.1638.61 ▼1.8736.10 ▼1.23
Add New Post /wp-admin/post-new.php1,557 ▲2423.38 ▲0.08695.01 ▲25.5058.67 ▼1.96
Media Library /wp-admin/upload.php1,415 ▲274.21 ▲0.01109.78 ▲1.6646.09 ▲3.38
Woocommerce /wp-admin/admin.php?page=wp-centrico-woocommerce7031.536.5816.52
Settings /wp-admin/admin.php?page=wp-centrico8112.0328.1523.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_centrico_widget
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% 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
    • > GET request to /wp-admin/admin.php?page=wp-centrico-woocommerce
    • > Error in wp-content/plugins/wp-centrico/includes/woocommerce/view/settings.php+28
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/wp-centrico/includes/woocommerce/view/settings.php:28
    Stack trace:
    #0 wp-content/plugins/wp-centrico/includes/centrico-settings.php(16): require()
    #1 wp-includes/class-wp-hook.php(310): centrico_woocommerce_init()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-centrico/includes/options-gui.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-centrico/includes/options-gui.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-centrico/includes/woocommerce/view/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-centrico/includes/centrico-form.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-centrico/includes/centrico-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-centrico/wp-centrico.php:69
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-centrico/includes/centrico-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-centrico/includes/woocommerce/view/subscribe.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === wp-centrico === )
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

wp-centrico/wp-centrico.php Passed 13 tests

The primary PHP file in "WP Centrico" version 1.1.5 is used by WordPress to initiate all plugin functionality
33 characters long description:
Simple Centrico subscription form

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected580 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8193114580

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.00
▷ Minimum class complexity4.00
▷ Maximum class complexity8.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png122.88KB34.34KB▼ 72.05%
includes/images/logo.png32.53KB15.13KB▼ 53.49%