66% directorist

Code Review | Directorist - WordPress Business Directory Plugin with Classified Ads Listings

WordPress plugin Directorist - WordPress Business Directory Plugin with Classified Ads Listings scored66%from 54 tests.

About plugin

  • Plugin page: directorist
  • Plugin version: 7.8.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Aug 27, 2017
  • Latest release: Nov 16, 2023
  • Number of updates: 232
  • Update frequency: every 9.8 days
  • Top authors: aazztech (59.91%)rafiq91 (39.22%)armanul94 (1.29%)

Code review

54 tests

User reviews

463 reviews

Install metrics

10,000+ active /491,214 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.32MB] [CPU: ▲12.65ms] 75% from 4 tests

Analyzing server-side resources used by Directorist - WordPress Business Directory Plugin with Classified Ads Listings
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,137.49ms on /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-extension)
PageMemory (MB)CPU Time (ms)
Home /4.75 ▲1.2856.66 ▲10.25
Dashboard /wp-admin4.64 ▲1.33102.87 ▲50.64
Posts /wp-admin/edit.php4.68 ▲1.3260.98 ▲9.72
Add New Post /wp-admin/post-new.php7.82 ▲1.94136.88 ▲17.41
Media Library /wp-admin/upload.php4.57 ▲1.3450.92 ▲13.23
Add New /wp-admin/post-new.php?post_type=at_biz_dir4.7879.27
All Listings /wp-admin/edit.php?post_type=at_biz_dir4.6154.79
Settings /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings6.1767.60
Locations /wp-admin/edit-tags.php?taxonomy=at_biz_dir-location&post_type=at_biz_dir4.5950.91
Reviews /wp-admin/edit-comments.php?post_type=at_biz_dir4.5755.41
Directory Builder /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-layout-builder5.5860.38
Categories /wp-admin/edit-tags.php?taxonomy=at_biz_dir-category&post_type=at_biz_dir4.5957.62
Themes & Extensions /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-extension4.691,137.49
Tags /wp-admin/edit-tags.php?taxonomy=at_biz_dir-tags&post_type=at_biz_dir4.5951.56
Help & Support /wp-admin/edit.php?post_type=at_biz_dir&page=directorist-status4.5141.60

Server storage [IO: ▲25.49MB] [DB: ▲0.06MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 25.49MB)
Filesystem: 5,380 new files
Database: no new tables, 26 new options
New WordPress options
widget_theysaidso_widget
widget_bdsw_widget
widget_bdsb_widget
widget_bdco_widget
widget_bdsi_widget
atbdp_option
widget_bdcw_widget
widget_bdmw_widget
widget_recent-comments
directorist_bulk_term_update_v7_0_3_2
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Directorist - WordPress Business Directory Plugin with Classified Ads Listings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14814.59 ▲0.241.94 ▼0.0044.30 ▼3.68
Dashboard /wp-admin2,283 ▲1095.54 ▼0.0497.07 ▲2.0377.76 ▲35.94
Posts /wp-admin/edit.php2,204 ▲1042.12 ▲0.1836.39 ▼7.8931.81 ▼10.05
Add New Post /wp-admin/post-new.php6,456 ▲4,93028.90 ▲5.68981.63 ▲253.9238.54 ▼20.17
Media Library /wp-admin/upload.php1,500 ▲1004.16 ▼0.06102.15 ▼22.5973.89 ▲28.94
Add New /wp-admin/post-new.php?post_type=at_biz_dir3,51411.81294.37179.72
All Listings /wp-admin/edit.php?post_type=at_biz_dir1,2192.1033.7729.41
Settings /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings1,5768.33186.2785.54
Locations /wp-admin/edit-tags.php?taxonomy=at_biz_dir-location&post_type=at_biz_dir1,5834.1857.7985.82
Reviews /wp-admin/edit-comments.php?post_type=at_biz_dir1,6342.2935.1632.25
Directory Builder /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-layout-builder8,8099.33176.72225.85
Categories /wp-admin/edit-tags.php?taxonomy=at_biz_dir-category&post_type=at_biz_dir9,2695.8475.06203.04
Themes & Extensions /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-extension2,7831.9936.0168.61
Tags /wp-admin/edit-tags.php?taxonomy=at_biz_dir-tags&post_type=at_biz_dir1,5233.7448.3086.29
Help & Support /wp-admin/edit.php?post_type=at_biz_dir&page=directorist-status2,9701.8832.0543.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 26 options
    • can_compress_scripts
    • db_upgraded
    • directorist_db_version
    • widget_bdcw_widget
    • widget_bdlf_widget
    • widget_bdco_widget
    • widget_bdsi_widget
    • atbdp_option
    • theysaidso_admin_options
    • widget_bdlw_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=at_biz_dir&page=directorist-status
    • > Warning in wp-content/plugins/directorist/includes/helper-functions.php+3072
    fsockopen(): unable to connect to ubuntu:25 (Connection refused)

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 items
  • 20× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/directorist/includes/classes/class-add-listing.php
    • > /wp-content/plugins/directorist/includes/classes/class-custom-taxonomy.php
    • > /wp-content/plugins/directorist/includes/classes/class-database.php
    • > /wp-content/plugins/directorist/views/admin-templates/theme-extensions/auth/license-auth-section.php
    • > /wp-content/plugins/directorist/includes/classes/class-cron.php
    • > /wp-content/plugins/directorist/includes/classes/class-email.php
    • > /wp-content/plugins/directorist/includes/classes/class-custom-post.php
    • > /wp-content/plugins/directorist/includes/checkout/functions.php
    • > /wp-content/plugins/directorist/directorist-base.php
    • > /wp-content/plugins/directorist/views/index.php
  • 74× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/directorist/includes/classes/class-geo-query.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_listing_terms() on null in wp-content/plugins/directorist/templates/listing-form/fields/category.php:14
    • > PHP Notice
      Trying to get property 'columns' of non-object in wp-content/plugins/directorist/templates/taxonomies/categories-list.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_directorist_option() in wp-content/plugins/directorist/views/admin-templates/post-types-manager/edit-listing-type.php:3
    • > PHP Notice
      Trying to get property 'columns' of non-object in wp-content/plugins/directorist/templates/taxonomies/locations-list.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Directorist\\Helper' not found in wp-content/plugins/directorist/templates/account/login.php:14
    • > PHP Notice
      Undefined variable: taxonomy in wp-content/plugins/directorist/templates/taxonomies/categories-grid.php on line 9
    • > PHP Warning
      Division by zero in wp-content/plugins/directorist/templates/taxonomies/locations-grid.php on line 10
    • > PHP Fatal error
      Trait 'Directorist\\Multi_Directory\\Multi_Directory_Helper' not found in wp-content/plugins/directorist/includes/modules/multi-directory-setup/class-multi-directory-manager.php on line 5
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/directorist/views/admin-templates/theme-extensions/theme-extension.php on line 6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=at_biz_dir
    • > Console-api (warning) in unknown
    /wp-content/plugins/directorist/assets/js/directorist-plupload.min.js?ver=7.8.1 0:1920 Object
    • > GET request to /wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-extension
    • > Network (severe)
    https://directorist.com/wp-content/uploads/edd/2021/09/ddoctors_theme.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #3, #30, #31, #4, #5, #6, #7, #8, #9 in directorist/assets to your readme.txt
The official readme.txt is a good inspiration

directorist/directorist-base.php 92% from 13 tests

Analyzing the main PHP file in "Directorist - WordPress Business Directory Plugin with Classified Ads Listings" version 7.8.1
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("directorist.php" instead of "directorist-base.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin332,850 lines of code in 4,998 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript15223,22027,063166,363
CSS3910,02980698,203
PHP41611,90211,19759,009
SVG4,358114,883
PO File11,4222,4143,395
JSON2600928
Sass410067
HTML2042

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity34.87
▷ Minimum class complexity1.00
▷ Maximum class complexity328.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces12
Interfaces0
Traits4
Classes163
▷ Abstract classes84.91%
▷ Concrete classes15595.09%
▷ Final classes10.65%
Methods1,807
▷ Static methods39621.91%
▷ Public methods1,58687.77%
▷ Protected methods1287.08%
▷ Private methods935.15%
Functions344
▷ Named functions31491.28%
▷ Anonymous functions308.72%
Constants50
▷ Global constants3978.00%
▷ Class constants1122.00%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
75 PNG files occupy 0.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/vendor-js/openstreet-map/openlayers/theme/default/img/navigation_history.png6.47KB2.31KB▼ 64.27%
assets/vendor-js/openstreet-map/openlayers/img/west-mini.png0.35KB0.32KB▼ 8.33%
assets/vendor-js/openstreet-map/openlayers/img/slider.png0.24KB0.24KB0.00%
assets/vendor-js/openstreet-map/openlayers4jgsi/crosshairs.png0.25KB0.16KB▼ 35.46%
assets/vendor-js/openstreet-map/openlayers/img/measuring-stick-on.png3.64KB0.30KB▼ 91.76%