68% wpdirectorykit

Code Review | WP Directory Kit

WordPress plugin WP Directory Kit scored68%from 54 tests.

About plugin

  • Plugin page: wpdirectorykit
  • Plugin version: 1.2.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Jan 28, 2021
  • Latest release: Oct 17, 2023
  • Number of updates: 50
  • Update frequency: every 19.9 days
  • Top authors: listingthemes (98%)sanwinter (4%)

Code review

54 tests

User reviews

23 reviews

Install metrics

2,000+ active /29,396 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.64MB] [CPU: ▲6.97ms] Passed 4 tests

An overview of server-side resources used by WP Directory Kit
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.07 ▲2.6055.06 ▲13.83
Dashboard /wp-admin6.31 ▲3.0175.27 ▲20.39
Posts /wp-admin/edit.php5.96 ▲2.6070.81 ▲29.00
Add New Post /wp-admin/post-new.php8.65 ▲2.7690.12 ▼15.72
Media Library /wp-admin/upload.php5.83 ▲2.5950.11 ▲9.36
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins5.9450.29

Server storage [IO: ▲26.19MB] [DB: ▲0.02MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • Total filesystem usage should be limited to 25MB (currently using 26.19MB)
Filesystem: 818 new files
Database: 15 new tables, 19 new options
New tables
wp_wdk_listings_categories
wp_wdk_messages
wp_wdk_locations
wp_wdk_token
wp_wdk_editlog
wp_wdk_listings_fields
wp_wdk_users
wp_wdk_listings
wp_wdk_listings_users
wp_wdk_listings_locations
...
New WordPress options
wdk_users_cached
dashboard_widget_options
widget_recent-comments
theysaidso_admin_options
elementor_experiment-e_dom_optimization
can_compress_scripts
widget_recent-posts
wdk_default_lat
wpdirectorykit_reviews_installed_on
wdk_is_results_page_require
...

Browser metrics Passed 4 tests

WP Directory Kit: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,509 ▲74814.56 ▲0.217.27 ▲5.4528.46 ▼16.20
Dashboard /wp-admin2,780 ▲6035.81 ▲0.23130.94 ▲31.2463.08 ▲20.45
Posts /wp-admin/edit.php2,264 ▲1642.08 ▲0.1437.91 ▲1.4939.16 ▲1.69
Add New Post /wp-admin/post-new.php1,658 ▲12322.98 ▲4.65638.85 ▲26.3959.76 ▼1.87
Media Library /wp-admin/upload.php1,560 ▲1634.35 ▲0.0996.85 ▼3.3344.22 ▲0.92
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,1892.0925.0337.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables detected upon uninstall: 15 tables
    • wp_wdk_token
    • wp_wdk_listings_fields
    • wp_wdk_resultitem
    • wp_wdk_dependfields
    • wp_wdk_listings_users
    • wp_wdk_searchform
    • wp_wdk_listings_categories
    • wp_wdk_editlog
    • wp_wdk_locations
    • wp_wdk_listings_locations
    • ...
  • This plugin does not fully uninstall, leaving 19 options in the database
    • wdk_is_results_page_require
    • dashboard_widget_options
    • wpdirectorykit_reviews_installed_on
    • elementor_experiment-landing-pages
    • wdk_default_lng
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • wdk_db_version
    • winter_mvc_active_plugins
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpdirectorykit/public/partials/wpdirectorykit-public-display.php
    • > /wp-content/plugins/wpdirectorykit/admin/partials/wpdirectorykit-admin-display.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/wpdirectorykit/tgm-pa/class-tgm-plugin-activation.php:2113
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpdirectorykit/vendor/Winter_MVC/init.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer_Logger' not found in wp-content/plugins/wpdirectorykit/vendor/WordPress-Importer/class-logger-serversentevents.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/wpdirectorykit/vendor/WordPress-Importer/class-wxr-importer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/wpdirectorykit/tgm-pa/class-tgm-plugin-activation.php:2113
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wpdirectorykit/translation_strings/categories_1.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wpdirectorykit/translation_strings/fields_1.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer_Logger' not found in wp-content/plugins/wpdirectorykit/vendor/WordPress-Importer/class-logger-html.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wpdirectorykit/translation_strings/locations_1.php:1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Elementor Elements, Featured Listings Example), #2 (Elementor Map and Search Listings Elements), #3 (Elementor Listing Categories Carousel Elements), #4 (Elementor Custom Listings Elements), #5 (Listing Preview Example for Directory), #6 (Search Form, Results with listings, Featured Listings and Categories), #7 (Elementor Categories Widget / Element), #8 (Elementor Header Example), #9 (Directory Listings Management), #10 (Add/Edit Directory Listings), #11 (Directory Fields Management visually), #12 (Directory Search Form Designer), #13 (Elementor Listing Preview build visual builder)
The official readme.txt might help

wpdirectorykit/wpdirectorykit.php Passed 13 tests

This is the main PHP file of "WP Directory Kit" version 1.2.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
85 characters long description:
Build your Directory portal, demos for Real Estate Agency and Car Dealership included

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin152,767 lines of code in 593 files:
LanguageFilesBlank linesComment linesLines of code
PHP30611,1839,19565,322
JavaScript11610,3437,97137,946
CSS802,22550617,694
Sass491,929510,861
PO File193,3818,0018,772
JSON2105,234
XML3025,145
Markdown62360855
LESS19816829
SVG1010100
HTML1209

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity27.72
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes116
▷ Abstract classes00.00%
▷ Concrete classes116100.00%
▷ Final classes00.00%
Methods1,097
▷ Static methods565.10%
▷ Public methods74367.73%
▷ Protected methods14713.40%
▷ Private methods20718.87%
Functions293
▷ Named functions22576.79%
▷ Anonymous functions6823.21%
Constants12
▷ Global constants758.33%
▷ Class constants541.67%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
64 compressed PNG files occupy 0.09MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/filetype/rar.png2.30KB2.30KB0.00%
public/img/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
public/js/openstreetmap/images/marker-shadow.png0.47KB0.50KB0.00%
public/img/filetype/yml.png1.20KB1.20KB0.00%
public/img/filetype/tiff.png1.76KB1.76KB0.00%