57% opal-service

Code Review | Opal Service

WordPress plugin Opal Service scored 57% from 54 tests.

About plugin

  • Plugin page: opal-service
  • Plugin version: 1.9.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 18, 2019
  • Latest release: Feb 6, 2023
  • Number of updates: 34
  • Update frequency: every 43.5 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 19,476 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.33MB] [CPU: ▼36.83ms] Passed 4 tests

Analyzing server-side resources used by Opal Service
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1823.12 ▼16.84
Dashboard /wp-admin3.69 ▲0.3823.79 ▼25.34
Posts /wp-admin/edit.php3.69 ▲0.3324.23 ▼23.65
Add New Post /wp-admin/post-new.php3.69 ▼2.2022.61 ▼81.49
Media Library /wp-admin/upload.php3.69 ▲0.4623.81 ▼12.24
Tags /wp-admin/edit-tags.php?taxonomy=opalservice_tags&post_type=opal_service3.6925.92
Add Service /wp-admin/post-new.php?post_type=opal_service3.6922.92
Categories /wp-admin/edit-tags.php?taxonomy=opalservice_category_service&post_type=opal_service3.6924.07
Settings /wp-admin/edit.php?post_type=opal_service&page=opalservice-settings3.6924.64
Services /wp-admin/edit.php?post_type=opal_service3.6923.16

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 479 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
opalservice_settings
can_compress_scripts
theysaidso_admin_options
widget_opalservice_category_service_widget
opalservice_setup
widget_recent-comments
widget_opalservice_sidebar_service_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opal Service
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲20513.76 ▼0.617.09 ▲5.4641.97 ▼5.63
Dashboard /wp-admin2,249 ▲614.90 ▼0.05113.35 ▲10.0343.30 ▼1.49
Posts /wp-admin/edit.php2,132 ▲432.03 ▼0.1534.93 ▼5.8133.07 ▼1.58
Add New Post /wp-admin/post-new.php1,550 ▲3623.33 ▲5.86610.17 ▼60.8353.91 ▼5.31
Media Library /wp-admin/upload.php1,425 ▲404.27 ▲0.1094.96 ▼4.8241.73 ▼4.82
Tags /wp-admin/edit-tags.php?taxonomy=opalservice_tags&post_type=opal_service1,3022.1525.5427.20
Add Service /wp-admin/post-new.php?post_type=opal_service2,4427.92191.2970.08
Categories /wp-admin/edit-tags.php?taxonomy=opalservice_category_service&post_type=opal_service1,4923.1544.6528.58
Settings /wp-admin/edit.php?post_type=opal_service&page=opalservice-settings7261.146.7815.72
Services /wp-admin/edit.php?post_type=opal_service1,1181.9531.8226.76

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php+44
    include_once(wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • This plugin does not fully uninstall, leaving 11 options in the database
    • recovery_mode_email_last_sent
    • widget_opalservice_category_service_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • opalservice_settings
    • db_upgraded
    • widget_theysaidso_widget
    • opalservice_setup
    • widget_opalservice_sidebar_service_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=opal_service
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php+44
    include_once(wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=opal_service
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php+44
    include_once(): Failed opening 'wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/CMB2_Hookup.php' for inclusion (include_path='.:/usr/share/php')
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=opal_service
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'CMB2_Hookup' not found
    • > GET request to /wp-admin/edit.php?post_type=opal_service&page=opalservice-settings
    • > Error in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php+331
    Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php:331
    Stack trace:
    #0 wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/helper-functions.php(363): cmb2_print_metabox_form()
    #1 wp-content/plugins/opal-service/inc/admin/register-settings.php(138): cmb2_metabox_form()
    #2 wp-includes/class-wp-hook.php(310): Opalservice_Plugin_Settings->admin_page_display()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/edit.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/opal-service/templates/content-opal-service.php
    • > /wp-content/plugins/opal-service/opalservice.php
    • > /wp-content/plugins/opal-service/templates/content-single-service.php
  • 92× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/opal-service/templates/kingcomposer/element_service_tabs_service.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/opal-service/inc/vendors/cmb2/libraries/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_postdata() in wp-content/plugins/opal-service/templates/shortcodes/list-services.php:59
    • > PHP Notice
      Undefined variable: limit in wp-content/plugins/opal-service/templates/kingcomposer/element_service_list_service.php on line 5
    • > PHP Warning
      array_merge(): Expected parameter 2 to be an array, null given in wp-content/plugins/opal-service/templates/kingcomposer/element_service_tabs_service.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/opal-service/inc/vendors/cmb2/custom-fields/upload/media-avatar-tpl.php:12
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/opal-service/templates/kingcomposer/element_service_carousel_service.php on line 15
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/opal-service/templates/kingcomposer/element_service_carousel_service.php on line 16
    • > PHP Notice
      Undefined variable: column in wp-content/plugins/opal-service/templates/kingcomposer/element_service_list_service.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function vc_map_get_attributes() in wp-content/plugins/opal-service/templates/vc_templates/opalservice_vc_category_service.php:9

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
    • > GET request to /wp-admin/post-new.php?post_type=opal_service
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).fontIconPicker is not a function" "TypeError: $(...).fontIconPicker is not a function\n at Object.init (/wp-content/plugins/opal-service/assets/js/opalservice.js?ver=1.0.0:96:29)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/opal-service/assets/js/opalservice.js?ver=1.0.0:167:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=opal_service
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).fontIconPicker is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
1 plugin tags: services

opal-service/opalservice.php 92% from 13 tests

The primary PHP file in "Opal Service" version 1.9.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("opal-service.php" instead of "opalservice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin64,874 lines of code in 309 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP1243,1437,54812,859
CSS394731,36711,995
JavaScript171,5378865,391
SVG5001,592
Markdown32330701
JSON10013

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.74
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes101
▷ Abstract classes98.91%
▷ Concrete classes9291.09%
▷ Final classes11.09%
Methods677
▷ Static methods15322.60%
▷ Public methods57885.38%
▷ Protected methods9514.03%
▷ Private methods40.59%
Functions74
▷ Named functions74100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants1246.15%
▷ Class constants1453.85%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
19 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/vendors/cmb2/libraries/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/vendors/cmb2/libraries/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
inc/vendors/cmb2/libraries/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
inc/vendors/cmb2/libraries/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
assets/img/service-icon.png1.67KB1.37KB▼ 18.05%