55% directorypress

Code Review | DirectoryPress - Business Directory And Classified Ad Listing

WordPress plugin DirectoryPress - Business Directory And Classified Ad Listing scored55%from 54 tests.

About plugin

  • Plugin page: directorypress
  • Plugin version: 3.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 13, 2009
  • Latest release: Oct 17, 2023
  • Number of updates: 61
  • Update frequency: every 84.9 days
  • Top authors: designinvento (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /8,950 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.08MB] [CPU: ▲24.59ms] 50% from 4 tests

A check of server-side resources used by DirectoryPress - Business Directory And Classified Ad Listing
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 858.36ms on /wp-admin/admin.php?page=directorypress_extensions)
  • RAM: Try to keep total memory usage under 10MB (currently 34.17MB on /wp-admin/admin.php?page=directorypress_settings)
PageMemory (MB)CPU Time (ms)
Home /7.92 ▲4.4665.62 ▲27.16
Dashboard /wp-admin6.40 ▲3.0983.23 ▲36.35
Posts /wp-admin/edit.php6.44 ▲3.0975.94 ▲31.70
Add New Post /wp-admin/post-new.php8.93 ▲3.05106.93 ▲3.66
Media Library /wp-admin/upload.php6.32 ▲3.0970.81 ▲35.85
Extensions /wp-admin/admin.php?page=directorypress_extensions7.37858.36
Listing locations /wp-admin/edit-tags.php?taxonomy=directorypress-location&post_type=dp_listing6.3564.54
Listing categories /wp-admin/edit-tags.php?taxonomy=directorypress-category&post_type=dp_listing6.3458.70
Author Note /wp-admin/options.php?page=directorypress_author_note_to_admin6.3260.58
Change package of listing /wp-admin/options.php?page=directorypress_upgrade6.2956.25
Listing tags /wp-admin/edit-tags.php?taxonomy=directorypress-tag&post_type=dp_listing6.3463.02
Settings /wp-admin/admin.php?page=directorypress_settings34.17196.66
Create new listing /wp-admin/post-new.php?post_type=dp_listing6.1559.99
Choose package of new listing /wp-admin/options.php?page=directorypress_choose_package6.2960.24
Redux /wp-admin/options-general.php?page=redux-framework6.3865.01

Server storage [IO: ▲17.56MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 1,340 new files
Database: 7 new tables, 28 new options
New tables
wp_directorypress_locations_relation
wp_directorypress_fields
wp_directorypress_packages
wp_directorypress_directorytypes
wp_directorypress_locations_depths
wp_directorypress_fields_groups
wp_directorypress_packages_relation
New WordPress options
theysaidso_admin_options
directorypress-dynamic.css_sha1
widget_directorypress_social_widget
directorypress_db_update_3_6_0
widget_directorypress_categories_widget
global_assets_timestamp
widget_directorypress_listings_widget
can_compress_scripts
widget_directorypress_resurva_widget
widget_directorypress_bids_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by DirectoryPress - Business Directory And Classified Ad Listing
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,462 ▲71616.88 ▲2.5132.54 ▲30.9657.46 ▲13.92
Dashboard /wp-admin2,501 ▲3246.65 ▲1.04113.87 ▲27.2097.84 ▲54.33
Posts /wp-admin/edit.php2,442 ▲3423.32 ▲1.3352.31 ▲17.0865.16 ▲30.35
Add New Post /wp-admin/post-new.php1,671 ▲14524.37 ▲1.42556.92 ▼42.5328.42 ▼28.29
Media Library /wp-admin/upload.php1,524 ▲1244.60 ▲0.4382.77 ▼15.0096.89 ▲48.34
Extensions /wp-admin/admin.php?page=directorypress_extensions1,3343.6545.67121.27
Listing locations /wp-admin/edit-tags.php?taxonomy=directorypress-location&post_type=dp_listing1,6793.8949.6299.90
Listing categories /wp-admin/edit-tags.php?taxonomy=directorypress-category&post_type=dp_listing1,8604.3658.7074.18
Author Note /wp-admin/options.php?page=directorypress_author_note_to_admin1,1043.6443.0063.25
Change package of listing /wp-admin/options.php?page=directorypress_upgrade7751.9115.8016.00
Listing tags /wp-admin/edit-tags.php?taxonomy=directorypress-tag&post_type=dp_listing1,5633.7247.2981.78
Settings /wp-admin/admin.php?page=directorypress_settings13,0746.46125.18158.65
Create new listing /wp-admin/post-new.php?post_type=dp_listing3,1178.39180.75150.58
Choose package of new listing /wp-admin/options.php?page=directorypress_choose_package7951.9115.6318.17
Redux /wp-admin/options-general.php?page=redux-framework1,2964.9985.66122.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 7 tables
    • wp_directorypress_fields_groups
    • wp_directorypress_packages_relation
    • wp_directorypress_locations_depths
    • wp_directorypress_fields
    • wp_directorypress_packages
    • wp_directorypress_locations_relation
    • wp_directorypress_directorytypes
  • This plugin did not uninstall successfully, leaving 28 options in the database
    • widget_directorypress_listings_widget
    • widget_directorypress_social_widget
    • directorypress_installed_directory
    • widget_theysaidso_widget
    • widget_recent-posts
    • directorypress_db_update_3_4_1
    • global_assets_timestamp
    • widget_directorypress_author
    • widget_recent-comments
    • widget_directorypress_categories_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options.php?page=directorypress_choose_package
    • > Error in wp-content/plugins/directorypress/admin/class-directorypress-admin.php+49
    Uncaught Error: Call to a member function displayChooseLevelTable() on null in wp-content/plugins/directorypress/admin/class-directorypress-admin.php:49
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): DirectoryPress_Admin->chooseLevelsPage()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/options.php(19): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

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
The following issues need your attention
  • 11× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/directorypress/public/partials/single-listing/slider.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/tabs.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/video-gallery.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/location.php
    • > /wp-content/plugins/directorypress/admin/partials/themes.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/gallery.php
    • > /wp-content/plugins/directorypress/includes/css_editor.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/booking-button.php
    • > /wp-content/plugins/directorypress/admin/partials/addons.php
    • > /wp-content/plugins/directorypress/public/partials/single-listing/listing-id.php
  • 511× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'DIRECTORYPRESS_PATHincludes/core/search/class_search_filter.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/directorypress/includes/core/search/class_filters.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'directorypress_post' not found in wp-content/plugins/directorypress/includes/core/listing/class-listing.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/directorypress/admin/redux-core/inc/fields/textarea/field_textarea.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/directorypress/admin/redux-core/inc/fields/raw/field_raw.php:8
    • > PHP Notice
      Trying to get property 'locations' of non-object in wp-content/plugins/directorypress/public/partials/single-listing/location.php on line 15
    • > PHP Notice
      Undefined property: stdClass::$hash in wp-content/plugins/directorypress/public/partials/directory-pages/category-page.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function directorypress_has_map() in wp-content/plugins/directorypress/public/partials/directory-pages/location-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/directorypress/public/emails/contact_form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/directorypress/includes/core/widgets/directorypress_general_widgets.php:2
    • > PHP Warning
      Use of undefined constant DIRECTORYPRESS_PATH - assumed 'DIRECTORYPRESS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/directorypress/includes/core/fields/class_fields.php on line 12

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options.php?page=directorypress_choose_package
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/directorypress/admin/assets/js/directorypress-admin.js?ver=6.3.1:457:60)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options.php?page=directorypress_choose_package
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: business directory, directory listing, directories, classified, car dealer

directorypress/directorypress.php 85% from 13 tests

The main PHP file in "DirectoryPress - Business Directory And Classified Ad Listing" ver. 3.6.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 180 characters long)
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin148,389 lines of code in 960 files:
LanguageFilesBlank linesComment linesLines of code
PHP48511,59315,33666,518
JavaScript2356,9584,20132,527
CSS1307,47366025,736
Sass921,8518812,603
SVG16781310,990
XML10012
Markdown1103

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity33.90
▷ Minimum class complexity1.00
▷ Maximum class complexity341.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces0
Interfaces7
Traits0
Classes232
▷ Abstract classes52.16%
▷ Concrete classes22797.84%
▷ Final classes00.00%
Methods1,950
▷ Static methods32516.67%
▷ Public methods1,66685.44%
▷ Protected methods1919.79%
▷ Private methods934.77%
Functions400
▷ Named functions39598.75%
▷ Anonymous functions51.25%
Constants120
▷ Global constants2117.50%
▷ Class constants9982.50%
▷ Public constants99100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
125 PNG files occupy 0.51MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-core/assets/img/2-col-portfolio.png0.15KB0.15KB0.00%
assets/css/jqueryui/themes/smoothness/images/ui-icons_2e83ff_256x240.png4.56KB4.18KB▼ 8.31%
assets/images/map_edit.png0.56KB0.51KB▼ 9.53%
admin/redux-core/assets/img/3cl.png0.34KB0.33KB0.29%
admin/redux-core/assets/img/raw/2cr.png2.92KB0.24KB▼ 91.69%