78% doctorlogic-components

Code Review | DoctorLogic Components

WordPress plugin DoctorLogic Components scored78%from 54 tests.

About plugin

  • Plugin page: doctorlogic-compo...
  • Plugin version: 2.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.1
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: Aug 29, 2019
  • Number of updates: 40
  • Update frequency: every 39.4 days
  • Top authors: DoctorLogic (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,421 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.42ms] 75% from 4 tests

Analyzing server-side resources used by DoctorLogic Components
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 726.56ms on /wp-admin/admin.php?page=dl__shortcodes)
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0723.69 ▼21.80
Dashboard /wp-admin3.32 ▲0.0245.94 ▼2.75
Posts /wp-admin/edit.php3.37 ▲0.0247.44 ▲2.07
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.60 ▼2.37
Media Library /wp-admin/upload.php3.24 ▲0.0234.75 ▲1.24
Diagnostics /wp-admin/admin.php?page=dl__diagnostics3.202,230.74
General /wp-admin/admin.php?page=doctorlogic-components/inc/options-page.php3.2132.83
Shortcodes /wp-admin/admin.php?page=dl__shortcodes3.18726.56
Advanced Styles /wp-admin/admin.php?page=dl__advancedstyles3.1831.07

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for DoctorLogic Components
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲18213.57 ▼1.018.07 ▲6.0639.90 ▼4.35
Dashboard /wp-admin2,243 ▲575.84 ▲0.87110.17 ▼14.4173.97 ▲29.27
Posts /wp-admin/edit.php2,129 ▲372.03 ▲0.0137.99 ▲0.2433.80 ▲2.41
Add New Post /wp-admin/post-new.php1,695 ▲17622.05 ▼1.18664.72 ▲48.0045.09 ▼2.63
Media Library /wp-admin/upload.php1,419 ▲314.22 ▲0.0196.80 ▲0.2277.85 ▲34.04
Diagnostics /wp-admin/admin.php?page=dl__diagnostics9292.0324.8832.93
General /wp-admin/admin.php?page=doctorlogic-components/inc/options-page.php9442.0324.3429.40
Shortcodes /wp-admin/admin.php?page=dl__shortcodes8532.0223.5628.23
Advanced Styles /wp-admin/admin.php?page=dl__advancedstyles1,1472.0524.1130.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=dl__diagnostics
    • > Warning in wp-content/plugins/doctorlogic-components/inc/options-page.php+556
    file_get_contents(https://admin.doctorlogic.com/api/site//testimonial?isPublished=true&topN=500&cachebust=1696686670.3782): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    • > GET request to /wp-admin/admin.php?page=dl__diagnostics
    • > Warning in wp-content/plugins/doctorlogic-components/inc/options-page.php+558
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Warning in wp-content/plugins/doctorlogic-components/inc/options-page.php+402
    file_get_contents(https://admin.doctorlogic.com/api/site//gallery/listcomponent): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+413
    Trying to get property 'MasterPage' of non-object
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+410
    Trying to get property 'Facilities' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Warning in wp-content/plugins/doctorlogic-components/inc/options-page.php+425
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+411
    Trying to get property 'Practitioners' of non-object
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+412
    Trying to get property 'PersonnelList' of non-object
    • > GET request to /wp-admin/admin.php?page=dl__shortcodes
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+413
    Trying to get property 'Procedures' of non-object
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dl__advancedstyles
    • > Warning in wp-content/plugins/doctorlogic-components/inc/options-page.php+336
    Use of undefined constant ob_start - assumed 'ob_start' (this will throw an Error in a future version of PHP)
  • 28 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dl__advancedstyles
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+322
    Trying to access array offset on value of type bool
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dl__advancedstyles
    • > Notice in wp-content/plugins/doctorlogic-components/inc/options-page.php+353
    ob_end_clean(): failed to delete buffer. No buffer to delete

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
Please fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/doctorlogic-components/inc/review-summary.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_uninstall_hook() in wp-content/plugins/doctorlogic-components/doctorlogic.wordpressplugin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/doctorlogic-components/inc/options-page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/doctorlogic-components/inc/review-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/doctorlogic-components/inc/palette.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: websites, doctors, reviews, medical, galleries

doctorlogic-components/doctorlogic.wordpressplugin.php 92% from 13 tests

"DoctorLogic Components" version 2.2.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("doctorlogic-components.php" instead of "doctorlogic.wordpressplugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,256 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10183551,451
CSS21615486
HTML2220249
JavaScript118270

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.24MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png116.66KB53.29KB▼ 54.32%
assets/screenshot-2.png119.37KB48.08KB▼ 59.72%
assets/icon-128x128.png5.15KB1.81KB▼ 64.88%
img/icon.png0.43KB0.53KB0.00%