94% dt-directory-lite-addon

Code Review | DT Directory Lite Addon

WordPress plugin DT Directory Lite Addon scored 94% from 54 tests.

About plugin

  • Plugin page: dt-directory-lite...
  • Plugin version: 1.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9
  • WordPress version: 5.9.2
  • First release: Dec 10, 2020
  • Latest release: Mar 8, 2022
  • Number of updates: 400
  • Update frequency: every 1.1 days
  • Top authors: designthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,418 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲1.86MB] [CPU: ▼351.17ms] Passed 4 tests

Analyzing server-side resources used by DT Directory Lite Addon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.55 ▲2.0362.64 ▲12.24
Dashboard /wp-admin5.30 ▲1.8945.71 ▲10.84
Posts /wp-admin/edit.php5.51 ▲1.8854.51 ▲15.55
Add New Post /wp-admin/post-new.php8.77 ▲1.80104.37 ▼1,431.42
Media Library /wp-admin/upload.php5.18 ▲1.8834.13 ▲3.68
Property Contract Type /wp-admin/edit-tags.php?taxonomy=dtdr_listings_ctype&post_type=dtdr_listings5.1836.26
Settings /wp-admin/edit.php?post_type=dtdr_listings&page=dtdr-settings-options5.2642.72
Property Amenity /wp-admin/edit-tags.php?taxonomy=dtdr_listings_amenity&post_type=dtdr_listings5.1835.38
Directory /wp-admin/edit.php?post_type=dtdr_listings5.2936.35
Property Category /wp-admin/edit-tags.php?taxonomy=dtdr_listings_category&post_type=dtdr_listings5.1833.68

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 359 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

DT Directory Lite Addon: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,085 ▲35317.67 ▲1.9218.49 ▲11.662.25 ▼0.02
Dashboard /wp-admin2,976 ▲1156.14 ▼0.08121.07 ▼22.77161.75 ▲7.12
Posts /wp-admin/edit.php2,773 ▲823.25 ▲0.0163.16 ▼2.70146.29 ▲1.39
Add New Post /wp-admin/post-new.php1,714 ▼4615.66 ▼6.30432.98 ▲2.79154.93 ▼3.43
Media Library /wp-admin/upload.php1,780 ▲825.50 ▼0.04147.46 ▲10.22190.59 ▲2.84
Property Contract Type /wp-admin/edit-tags.php?taxonomy=dtdr_listings_ctype&post_type=dtdr_listings2,6084.0884.51158.03
Settings /wp-admin/edit.php?post_type=dtdr_listings&page=dtdr-settings-options1,4613.1561.04162.21
Property Amenity /wp-admin/edit-tags.php?taxonomy=dtdr_listings_amenity&post_type=dtdr_listings2,5754.0589.26161.32
Directory /wp-admin/edit.php?post_type=dtdr_listings1,5153.3164.13116.72
Property Category /wp-admin/edit-tags.php?taxonomy=dtdr_listings_category&post_type=dtdr_listings2,6084.0586.12168.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% 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 50% 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
Please fix the following items
  • 176× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dt-directory-lite-addon/modules/pricing/page-builders/visual-composer/sf-price-range.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/dt-directory-lite-addon/page-builders/elementor/widgets/single-page/dates.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dt-directory-lite-addon/utils/utils.php:318
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/dt-directory-lite-addon/templates/tpl-single-listing.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/dt-directory-lite-addon/custom-post-types/metaboxes/tabs/general.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dt-directory-lite-addon/page-builders/visual-composer/modules/single-page/dates.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/dt-directory-lite-addon/modules/pricing/page-builders/elementor/sf-price-range.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dt-directory-lite-addon/modules/pricing/shortcodes.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/dt-directory-lite-addon/modules/pricing/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/dt-directory-lite-addon/modules/pricing/metabox-tab-price.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 39 tag instead of maximum 10
The official readme.txt might help

dt-directory-lite-addon/dt-directory-lite-addon.php 92% from 13 tests

The main PHP script in "DT Directory Lite Addon" version 1.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin48,109 lines of code in 234 files:
LanguageFilesBlank linesComment linesLines of code
PHP1765,9061,22119,726
CSS252,17532815,802
SVG40129,848
JavaScript279362272,680
XML13050
Markdown1003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.28
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes72
▷ Abstract classes00.00%
▷ Concrete classes72100.00%
▷ Final classes00.00%
Methods561
▷ Static methods274.81%
▷ Public methods45781.46%
▷ Protected methods9617.11%
▷ Private methods81.43%
Functions166
▷ Named functions16599.40%
▷ Anonymous functions10.60%
Constants1
▷ Global constants1100.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
85 PNG files occupy 0.17MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
page-builders/visual-composer/images/portfolio_terms.png1.30KB0.19KB▼ 85.19%
assets/css/chosen-sprite.png0.53KB0.88KB0.00%
custom-post-types/metaboxes/images/column-selected-left.png1.41KB0.89KB▼ 36.57%
assets/images/prettyPhoto/default/default_thumb.png1.50KB0.61KB▼ 59.47%
page-builders/visual-composer/images/related_portfolios.png1.77KB0.42KB▼ 76.42%