57% wpopal-medical

Code Review | Wpopal Medical

WordPress plugin Wpopal Medical scored57%from 54 tests.

About plugin

  • Plugin page: wpopal-medical
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 13, 2019
  • Latest release: Apr 4, 2022
  • Number of updates: 7
  • Update frequency: every 151.1 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,016 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.56ms] Passed 4 tests

An overview of server-side resources used by Wpopal Medical
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4345.00 ▲5.05
Dashboard /wp-admin3.72 ▲0.4151.13 ▲5.30
Posts /wp-admin/edit.php3.77 ▲0.4151.53 ▲7.14
Add New Post /wp-admin/post-new.php6.26 ▲0.3784.58 ▼22.23
Media Library /wp-admin/upload.php3.58 ▲0.3542.43 ▲5.63
Categories /wp-admin/edit-tags.php?taxonomy=opalmedical_category_doctor&post_type=opal_doctor3.5737.42
Settings /wp-admin/edit.php?post_type=opal_doctor&page=opalmedical-settings3.5332.83
Departments /wp-admin/edit-tags.php?taxonomy=opalmedical_department_doctor&post_type=opal_doctor3.5735.71
Add Doctor /wp-admin/post-new.php?post_type=opal_doctor3.7755.09
Doctors /wp-admin/edit.php?post_type=opal_doctor3.6946.68

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 90 new files
Database: no new tables, 11 new options
New WordPress options
widget_opalmedical_category_doctor_widget
db_upgraded
widget_recent-posts
recovery_mode_email_last_sent
widget_theysaidso_widget
widget_recent-comments
opalmedical_setup
widget_opalmedical_sidebar_medical_widget
opalmedical_settings
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wpopal Medical
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16213.47 ▼1.098.60 ▲6.9839.01 ▲1.15
Dashboard /wp-admin2,241 ▲605.65 ▼0.0782.63 ▼14.0537.43 ▼4.21
Posts /wp-admin/edit.php2,146 ▲462.04 ▲0.0439.73 ▲2.8837.49 ▲4.25
Add New Post /wp-admin/post-new.php1,562 ▲3623.75 ▲2.77674.50 ▲67.8856.92 ▲11.07
Media Library /wp-admin/upload.php1,437 ▲434.18 ▼0.0097.18 ▼2.0641.64 ▼0.98
Categories /wp-admin/edit-tags.php?taxonomy=opalmedical_category_doctor&post_type=opal_doctor1,3142.1226.8428.75
Settings /wp-admin/edit.php?post_type=opal_doctor&page=opalmedical-settings7341.516.7919.59
Departments /wp-admin/edit-tags.php?taxonomy=opalmedical_department_doctor&post_type=opal_doctor1,3202.1226.3828.62
Add Doctor /wp-admin/post-new.php?post_type=opal_doctor2,4517.71167.5161.56
Doctors /wp-admin/edit.php?post_type=opal_doctor1,1321.9229.0130.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'opalmedical_uninstall' not found or invalid function name
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_recent-comments
    • opalmedical_settings
    • opalmedical_setup
    • db_upgraded
    • theysaidso_admin_options
    • widget_opalmedical_category_doctor_widget
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_opalmedical_sidebar_medical_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
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=opal_doctor&page=opalmedical-settings
    • > Error in wp-content/plugins/wpopal-medical/inc/admin/register-settings.php+138
    Uncaught Error: Call to undefined function cmb2_metabox_form() in wp-content/plugins/wpopal-medical/inc/admin/register-settings.php:138
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Opalmedical_Plugin_Settings->admin_page_display()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/edit.php(10): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

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
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wpopal-medical/opalmedical.php
    • > /wp-content/plugins/wpopal-medical/templates/content-opal-medical.php
    • > /wp-content/plugins/wpopal-medical/templates/content-single-medical.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wpopal-medical/templates/department-opal_doctor.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Opalmedical_Query' not found in wp-content/plugins/wpopal-medical/templates/widgets/category_service/default.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wpopal-medical/templates/content-data-none.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_postdata() in wp-content/plugins/wpopal-medical/templates/shortcodes/list-medical.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wpopal-medical/templates/archive-opal_doctor.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/wpopal-medical/templates/widgets/sidebar_medical/default.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpopal-medical/inc/class-opalmedical-widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/wpopal-medical/templates/widgets/sidebar_service/default.php:5
    • > PHP Notice
      Undefined variable: column in wp-content/plugins/wpopal-medical/templates/shortcodes/carousel-medical.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpopal-medical/inc/widgets/categoty_service.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=opal_doctor
    • > Network (severe)
    wp-content/plugins/wpopal-medical/assets/js/opalmedical.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: medicals

wpopal-medical/opalmedical.php 92% from 13 tests

This is the main PHP file of "Wpopal Medical" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpopal-medical.php" instead of "opalmedical.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin13,786 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
CSS20991526,504
PHP416319423,407
JavaScript4895982,376
SVG4001,499

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.79
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods77
▷ Static methods3342.86%
▷ Public methods7192.21%
▷ Protected methods67.79%
▷ Private methods00.00%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/service-icon.png1.67KB1.37KB▼ 18.05%
assets/img/web-icon.png1.78KB1.41KB▼ 21.19%
assets/img/logo_opal.png1.70KB1.12KB▼ 34.27%