84% docpro

Code Review | Docpro

WordPress plugin Docpro scored84%from 54 tests.

About plugin

  • Plugin page: docpro
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 4, 2022
  • Latest release: Dec 4, 2022
  • Number of updates: 5
  • Update frequency: every 52.4 days
  • Top authors: rashid87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.49MB] [CPU: ▲37.62ms] Passed 4 tests

This is a short check of server-side resources used by Docpro
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.63 ▲3.16108.01 ▲64.51
Dashboard /wp-admin6.42 ▲3.07119.82 ▲57.80
Posts /wp-admin/edit.php6.47 ▲3.11114.16 ▲62.37
Add New Post /wp-admin/post-new.php6.53 ▲0.6469.47 ▼34.21
Media Library /wp-admin/upload.php6.39 ▲3.16109.63 ▲70.41

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 365 new files
Database: no new tables, 8 new options
New WordPress options
docpro_settings
widget_recent-posts
docpro_page_profiles
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Docpro: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,496 ▲75017.41 ▲3.1528.70 ▲26.9846.94 ▲3.24
Dashboard /wp-admin2,504 ▲3166.99 ▲1.88136.22 ▲34.6842.98 ▼0.17
Posts /wp-admin/edit.php2,411 ▲3223.85 ▲1.8552.13 ▲16.2333.70 ▼1.84
Add New Post /wp-admin/post-new.php1,648 ▲11123.39 ▲0.03621.26 ▼51.1234.45 ▼20.59
Media Library /wp-admin/upload.php1,551 ▲1634.75 ▲0.5284.25 ▼33.6144.22 ▼3.86
Clinic Settings /wp-admin/admin.php?page=docpro#tab=clinic-settings1,5273.7462.8340.47
Settings /wp-admin/admin.php?page=docpro#tab=settings1,5403.7452.3532.66
Booking Options /wp-admin/admin.php?page=docpro#tab=booking-options1,5283.7358.8733.51
Doctors Settings /wp-admin/admin.php?page=docpro#tab=doctors-settings1,5303.4950.0729.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • docpro_settings
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'DOCPRO_User_base' not found in wp-content/plugins/docpro/includes/classes/class-user-patient.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'DOCPRO_User_base' not found in wp-content/plugins/docpro/includes/classes/class-user-doctor.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/docpro/includes/classes/class-template-loader.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/docpro/includes/classes/class-hooks.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_User' not found in wp-content/plugins/docpro/includes/classes/class-user-base.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/docpro/includes/functions-template.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'DOCPRO_User_base' not found in wp-content/plugins/docpro/includes/classes/class-user-clinic.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'CSF' not found in wp-content/plugins/docpro/includes/classes/class-csf-extended.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function docpro() in wp-content/plugins/docpro/includes/classes/class-shortcodes.php:174
    • > PHP Fatal error
      Uncaught Error: Call to undefined function docpro() in wp-content/plugins/docpro/includes/classes/class-meta-boxes.php:796

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
There were no plugin tags found

docpro/docpro.php 92% from 13 tests

The principal PHP file in "Docpro" v. 2.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages/")

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
Success! There were no dangerous files found in this plugin86,691 lines of code in 224 files:
LanguageFilesBlank linesComment linesLines of code
SVG701630,201
CSS195,96770929,606
PHP1654,1162,92315,361
PO File203,1973,5946,534
JavaScript131,3966534,989

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity27.37
▷ Minimum class complexity1.00
▷ Maximum class complexity312.00
Average method complexity5.45
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes75
▷ Abstract classes22.67%
▷ Concrete classes7397.33%
▷ Final classes56.85%
Methods445
▷ Static methods5011.24%
▷ Public methods42795.96%
▷ Protected methods10.22%
▷ Private methods173.82%
Functions65
▷ Named functions5584.62%
▷ Anonymous functions1015.38%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
94 PNG files occupy 0.59MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/shape/shape-56.png1.75KB0.45KB▼ 74.18%
assets/images/shape/shape-59.png2.82KB0.98KB▼ 65.35%
assets/images/shape/shape-33.png9.61KB5.59KB▼ 41.82%
assets/images/shape/shape-23.png11.60KB4.86KB▼ 58.10%
assets/images/shape/shape-74.png4.92KB2.31KB▼ 53.08%