10% woptifications

Code Review | Woptifications

WordPress plugin Woptifications scored10%from 54 tests.

About plugin

  • Plugin page: woptifications
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 13, 2017
  • Latest release: Oct 6, 2017
  • Number of updates: 20
  • Update frequency: every 1.2 days
  • Top authors: woptima (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /738 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/woptifications/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value

Server metrics [RAM: ▼0.73MB] [CPU: ▼50.41ms] Passed 4 tests

An overview of server-side resources used by Woptifications
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.27 ▼0.1913.52 ▼27.64
Dashboard /wp-admin3.29 ▼0.0615.47 ▼51.58
Posts /wp-admin/edit.php3.29 ▼0.0714.51 ▼40.38
Add New Post /wp-admin/post-new.php3.29 ▼2.6015.65 ▼82.05
Media Library /wp-admin/upload.php3.29 ▲0.0612.87 ▼22.42
Redux Framework /wp-admin/tools.php?page=redux-about3.2914.08
Content settings /wp-admin/admin.php?page=woptifications_options_options&tab=33.2914.18
Notification type /wp-admin/admin.php?page=woptifications_options_options&tab=13.2914.54
Options Object /wp-admin/admin.php?page=woptifications_options_options&tab=103.2919.59
Hooks settings /wp-admin/admin.php?page=woptifications_options_options&tab=23.2915.63
Import / Export /wp-admin/admin.php?page=woptifications_options_options&tab=113.2913.32
Notification settings /wp-admin/admin.php?page=woptifications_options_options&tab=73.2917.96

Server storage [IO: ▲5.53MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 528 new files
Database: no new tables, 9 new options
New WordPress options
woptifications_options
widget_recent-posts
redux_version_upgraded_from
can_compress_scripts
woptifications_options-transients
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Woptifications
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,055 ▲30914.13 ▼0.1810.36 ▲8.6842.91 ▼0.87
Dashboard /wp-admin2,357 ▲1724.96 ▼0.8895.10 ▼10.9182.49 ▲40.31
Posts /wp-admin/edit.php2,174 ▲851.97 ▼0.0633.01 ▼4.9533.06 ▼0.98
Add New Post /wp-admin/post-new.php1,753 ▲23424.60 ▲1.41621.52 ▼62.6729.07 ▼21.75
Media Library /wp-admin/upload.php1,468 ▲864.15 ▼0.06107.99 ▲6.2976.76 ▲34.16
Redux Framework /wp-admin/tools.php?page=redux-about1,1533.6473.7072.05
Content settings /wp-admin/admin.php?page=woptifications_options_options&tab=33,6949.90243.71138.67
Notification type /wp-admin/admin.php?page=woptifications_options_options&tab=13,65710.02233.77102.41
Options Object /wp-admin/admin.php?page=woptifications_options_options&tab=103,6459.96229.7295.50
Hooks settings /wp-admin/admin.php?page=woptifications_options_options&tab=23,6559.70218.2696.88
Import / Export /wp-admin/admin.php?page=woptifications_options_options&tab=113,6469.97234.1796.29
Notification settings /wp-admin/admin.php?page=woptifications_options_options&tab=73,6769.95240.43110.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/woptifications/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • redux_version_upgraded_from
    • woptifications_options
    • woptifications_options-transients
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Warning in wp-content/plugins/woptifications/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • 52 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/admin/options-init.php+158
    Undefined index: user_custom_fields
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/inc/new_publish.php+14
    Undefined property: woptificationsNewPublish::$woptifications_options
  • 49 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/inc/new_publish.php+145
    Trying to access array offset on value of type null
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/inc/enqueue_scripts.php+82
    Undefined variable: cat_match
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/inc/enqueue_scripts.php+83
    Undefined variable: product_cat_match
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Notice in wp-content/plugins/woptifications/inc/enqueue_scripts.php+84
    Undefined variable: push_icon
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Error in wp-includes/Requests/src/Exception/InvalidArgument.php+29
    Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in wp-includes/Requests/src/Exception/InvalidArgument.php:29
    Stack trace:
    #0 wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
    #1 wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
    #2 wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
    #3 wp-includes/http.php(150): WP_Http->request()
    #4 wp-content/plugins/woptifications/admin/redux-framework/inc/class.p.php(230): wp_remote_request()
    #5 wp-includes/class-wp-hook.php(310): Redux_P->proxy()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin-ajax.php(188): do_action()
    #9 {ma

SRP 50% from 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
The following issues need your attention
  • 30× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'themecheck' not found in wp-content/plugins/woptifications/admin/redux-framework/inc/themecheck/checks/full_package.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woptifications/admin/redux-framework/templates/panel/footer.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woptifications/admin/redux-framework/templates/panel/content.tpl.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Redux' not found in wp-content/plugins/woptifications/woptifications_Plugin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woptifications/admin/redux-framework/inc/welcome/views/about.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woptifications/admin/redux-framework/inc/welcome/views/support.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Redux_Customizer_Control' not found in wp-content/plugins/woptifications/admin/redux-framework/inc/extensions/customizer/inc/customizer_fields.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/woptifications/admin/redux-framework/inc/extensions/customizer/inc/customizer_devs.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woptifications/admin/redux-framework/templates/panel/menu_container.tpl.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woptifications/inc/user_registration.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Network (severe)
    wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=3
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=3 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=1
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=1 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=10
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=10 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=2
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=2 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=11
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=11 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=woptifications_options_options&tab=7
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=woptifications_options_options&tab=7 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=c8ec9e72b7&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3Dc8ec9e72b7%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

woptifications/woptifications.php 92% from 13 tests

"Woptifications" version 2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin43,208 lines of code in 402 files:
LanguageFilesBlank linesComment linesLines of code
PHP1173,9035,49416,692
JavaScript1703,2672,57915,434
Sass541,181607,568
CSS51146591,060
JSON21840945
SVG100934
PO File2111117336
Markdown2440103
LESS22081
Bourne Shell124055

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity30.66
▷ Minimum class complexity1.00
▷ Maximum class complexity880.00
Average method complexity6.47
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes110
▷ Abstract classes00.00%
▷ Concrete classes110100.00%
▷ Final classes00.00%
Methods598
▷ Static methods10116.89%
▷ Public methods45776.42%
▷ Protected methods9115.22%
▷ Private methods508.36%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants57
▷ Global constants00.00%
▷ Class constants57100.00%
▷ Public constants57100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
33 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-framework/inc/fields/spinner/arrow_right.png0.15KB0.12KB▼ 18.18%
admin/redux-framework/assets/img/3cr.png2.98KB0.34KB▼ 88.66%
admin/redux-framework/inc/fields/spinner/arrow_left.png0.15KB0.12KB▼ 16.67%
admin/redux-framework/inc/fields/switch/slider-control.png1.65KB0.75KB▼ 54.62%
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%