78% ocean-extra

Code Review | Ocean Extra

WordPress plugin Ocean Extra scored78%from 54 tests.

About plugin

  • Plugin page: ocean-extra
  • Plugin version: 2.2.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2016
  • Latest release: Nov 27, 2023
  • Number of updates: 209
  • Update frequency: every 12.4 days
  • Top authors: oceanwp (67.46%)apprimit (28.71%)svovaf (4.78%)

Code review

54 tests

User reviews

68 reviews

Install metrics

700,000+ active /19,267,416 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.46ms] Passed 4 tests

Analyzing server-side resources used by Ocean Extra
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.58 ▼0.22
Dashboard /wp-admin3.41 ▲0.1046.74 ▼5.20
Posts /wp-admin/edit.php3.52 ▲0.1648.11 ▼3.93
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.08 ▼0.50
Media Library /wp-admin/upload.php3.33 ▲0.1033.65 ▲3.73

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 681 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
ocean-extra-version
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ocean Extra
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.23 ▲0.021.50 ▼0.4436.85 ▼7.17
Dashboard /wp-admin2,198 ▲185.61 ▼0.0293.77 ▲0.3140.56 ▼4.11
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0541.00 ▲2.7636.93 ▲0.76
Add New Post /wp-admin/post-new.php1,528 ▼723.13 ▼2.19626.50 ▼20.9955.06 ▼18.71
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0195.71 ▼1.9141.99 ▲2.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • ocean-extra-version
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 34× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/ocean-extra/includes/metabox/controls/range/template.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/section.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/control-checkboxes.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/controls/editor/template.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/control-range.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/controls/select/template.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/controls/textarea/template.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/control-select.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/control-editor.php
    • > /wp-content/plugins/ocean-extra/includes/metabox/butterbean/tmpl/control-parent.php
  • 59× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Setting' not found in wp-content/plugins/ocean-extra/includes/metabox/butterbean/inc/settings/class-setting-array.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_filter() in wp-content/plugins/ocean-extra/includes/themepanel/views/panes/extra-settings-widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/ocean-extra/includes/metabox/butterbean/inc/controls/class-control-textarea.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ocean-extra/includes/themepanel/views/panes/quick-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OE_Icon_Picker_Type_Font' not found in wp-content/plugins/ocean-extra/includes/menu-icons/includes/library/icon-selector/includes/types/genericon.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ocean-extra/includes/metabox/controls/typography/template.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/ocean-extra/includes/metabox/butterbean/inc/controls/class-control-checkboxes.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/ocean-extra/includes/metabox/controls/range/class-control-range.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/ocean-extra/includes/metabox/butterbean/inc/controls/class-control-datetime.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/ocean-extra/includes/metabox/butterbean/inc/controls/class-control-radio.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: metabox, metaboxes, meta box, oceanwp, widgets

ocean-extra/ocean-extra.php 92% from 13 tests

The primary PHP file in "Ocean Extra" version 2.2.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 146 characters long)

Code Analysis 97% from 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 plugin116,546 lines of code in 553 files:
LanguageFilesBlank linesComment linesLines of code
PHP32014,16127,08368,212
JavaScript765,6443,21421,782
CSS1221,76794716,419
PO File23,2055,0535,560
Sass16357201,902
SVG5361,816
Markdown62370664
JSON400106
XML281085

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 classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity39.20
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes190
▷ Abstract classes73.68%
▷ Concrete classes18396.32%
▷ Final classes147.65%
Methods2,234
▷ Static methods37016.56%
▷ Public methods1,69876.01%
▷ Protected methods1175.24%
▷ Private methods41918.76%
Functions215
▷ Named functions21097.67%
▷ Anonymous functions52.33%
Constants178
▷ Global constants11765.73%
▷ Class constants6134.27%
▷ Public constants61100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
63 compressed PNG files occupy 0.36MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/panel/assets/img/demos-import-image.png5.65KB5.62KB0.48%
includes/freemius/assets/img/ocean-hooks.png9.93KB3.39KB▼ 65.90%
includes/panel/assets/img/modal-window-image.png4.60KB4.58KB0.32%
includes/panel/assets/img/plugins/instagram.png2.38KB2.53KB0.00%
includes/panel/assets/img/rec-plugins/visual-composer-icon.png2.13KB2.14KB0.00%