62% dental-focus

Code Review | Dental Focus

WordPress plugin Dental Focus scored62%from 54 tests.

About plugin

  • Plugin page: dental-focus
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.0.3
  • WordPress version: 6.3.1
  • First release: Mar 2, 2017
  • Latest release: Feb 4, 2019
  • Number of updates: 9
  • Update frequency: every 77.7 days
  • Top authors: trentiums (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /896 total downloads

Benchmarks

Plugin footprint 65% 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.21MB] [CPU: ▼2.93ms] Passed 4 tests

Server-side resources used by Dental Focus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2146.06 ▲1.01
Dashboard /wp-admin3.52 ▲0.1753.34 ▼10.35
Posts /wp-admin/edit.php3.63 ▲0.2757.59 ▲7.03
Add New Post /wp-admin/post-new.php6.12 ▲0.2399.50 ▼9.41
Media Library /wp-admin/upload.php3.44 ▲0.2145.31 ▲7.43
Team Categories /wp-admin/edit-tags.php?taxonomy=df-team-categories&post_type=df-team3.4338.06
All Treatment /wp-admin/edit.php?post_type=df-treatment3.4844.02
Treatment Categories /wp-admin/edit-tags.php?taxonomy=df-treatment-categories&post_type=df-treatment3.4335.79
All Team /wp-admin/edit.php?post_type=df-team3.4842.68
All Banner /wp-admin/edit.php?post_type=df-banner3.4838.93
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=df-portfolio-categories&post_type=df-portfolio3.4336.64
Add New /wp-admin/post-new.php?post_type=df-banner3.5955.48
All Testimonial /wp-admin/edit.php?post_type=df-testimonial3.4841.98
Add New /wp-admin/post-new.php?post_type=df-treatment3.5954.60
Testimonial Categories /wp-admin/edit-tags.php?taxonomy=df-category-testimonial&post_type=df-testimonial3.4351.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Dental Focus
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲22714.70 ▲0.351.70 ▼0.0242.95 ▲1.46
Dashboard /wp-admin2,367 ▲1905.58 ▼0.0884.59 ▼5.3677.93 ▲34.02
Posts /wp-admin/edit.php2,290 ▲1901.99 ▲0.0237.76 ▲0.5735.26 ▼1.00
Add New Post /wp-admin/post-new.php1,695 ▲16918.17 ▼5.44746.42 ▲70.6655.02 ▲0.02
Media Library /wp-admin/upload.php1,584 ▲1814.02 ▼0.19117.39 ▲10.1875.87 ▲33.22
Team Categories /wp-admin/edit-tags.php?taxonomy=df-team-categories&post_type=df-team1,4612.1328.5335.13
All Treatment /wp-admin/edit.php?post_type=df-treatment1,2651.9033.2829.73
Treatment Categories /wp-admin/edit-tags.php?taxonomy=df-treatment-categories&post_type=df-treatment1,4612.1429.0931.64
All Team /wp-admin/edit.php?post_type=df-team1,2621.9430.2631.57
All Banner /wp-admin/edit.php?post_type=df-banner1,2651.9231.2329.78
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=df-portfolio-categories&post_type=df-portfolio1,4552.2627.7331.00
Add New /wp-admin/post-new.php?post_type=df-banner2,5837.94172.40121.67
All Testimonial /wp-admin/edit.php?post_type=df-testimonial1,2621.9332.2030.08
Add New /wp-admin/post-new.php?post_type=df-treatment2,5837.68166.70125.60
Testimonial Categories /wp-admin/edit-tags.php?taxonomy=df-category-testimonial&post_type=df-testimonial1,4552.1427.3330.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • dentalfocus_social_media
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/dental-focus/pages/dashboard.php
  • 38× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 29
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 53
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_IMAGES - assumed 'DENTALFOCUS_IMAGES' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 90
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 13
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 33
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 89
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 98
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 40
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 18
    • > PHP Warning
      Use of undefined constant DENTALFOCUS_WP_ADMIN_URL - assumed 'DENTALFOCUS_WP_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dental-focus/pages/dashboard.php on line 109

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=df-category-testimonial&post_type=df-testimonial
    • > Network (severe)
    wp-content/plugins/dental-focus/scripts/jquery.validationEngine.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=df-category-testimonial&post_type=df-testimonial
    • > Network (severe)
    wp-content/plugins/dental-focus/scripts/jquery.validationEngine-en.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention: Please take inspiration from this readme.txt

dental-focus/dentalfocus.php 85% from 13 tests

The main PHP script in "Dental Focus" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dental-focus.php" instead of "dentalfocus.php")
  • Description: The description should be shorter than 140 characters (currently 517 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,593 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32066191,515
PHP831151922
CSS2301156

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.00
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/dashboard-testimonials.png10.30KB4.46KB▼ 56.74%
images/dashboard-settings.png9.43KB6.01KB▼ 36.22%
images/dashboard-gallary.png2.62KB2.60KB▼ 0.75%
images/dashboard-treatments.png2.38KB2.41KB0.00%
images/dashboard-banner.png2.23KB1.30KB▼ 41.86%