62% business-directory-plugin

Code Review | Business Directory Plugin - Easy Listing Directories for WordPress

WordPress plugin Business Directory Plugin - Easy Listing Directories for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: business-director...
  • Plugin version: 6.3.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2011
  • Latest release: Oct 25, 2023
  • Number of updates: 483
  • Update frequency: every 9.1 days
  • Top authors: businessdirectoryplugin (87.16%)sswells (13.04%)

Code review

54 tests

User reviews

484 reviews

Install metrics

10,000+ active /1,581,047 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: ▲5.32MB] [CPU: ▲41.77ms] 75% from 4 tests

This is a short check of server-side resources used by Business Directory Plugin - Easy Listing Directories for WordPress
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.32MB on /wp-admin/admin.php?page=wpbdp_admin_payments)
PageMemory (MB)CPU Time (ms)
Home /7.83 ▲4.3790.93 ▲52.02
Dashboard /wp-admin8.94 ▲5.6084.17 ▲23.10
Posts /wp-admin/edit.php9.04 ▲5.6990.45 ▲43.76
Add New Post /wp-admin/post-new.php11.69 ▲5.80145.12 ▲55.00
Media Library /wp-admin/upload.php8.86 ▲5.6383.06 ▲48.20
Settings /wp-admin/admin.php?page=wpbdp_settings8.8785.14
Directory Tags /wp-admin/edit-tags.php?taxonomy=wpbdp_tag&post_type=wpbdp_listing8.9870.93
Themes /wp-admin/admin.php?page=wpbdp-themes8.8780.77
Directory /wp-admin/admin.php?page=wpbdp_admin8.8369.81
Directory Content /wp-admin/edit.php?post_type=wpbdp_listing8.9778.92
Import & Export /wp-admin/admin.php?page=wpbdp_admin_csv8.9173.08
Modules /wp-admin/admin.php?page=wpbdp-addons9.51373.90
Plans /wp-admin/admin.php?page=wpbdp-admin-fees8.9774.22
SMTP /wp-admin/admin.php?page=wpbdp-smtp8.8570.81
Payment History /wp-admin/admin.php?page=wpbdp_admin_payments8.9373.99

Server storage [IO: ▲6.17MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 558 new files
Database: 5 new tables, 15 new options
New tables
wp_wpbdp_form_fields
wp_wpbdp_plans
wp_wpbdp_logs
wp_wpbdp_payments
wp_wpbdp_listings
New WordPress options
wpbdp-show-drip-pointer
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
wpbdp_category_children
wpbdp_settings
widget_wpbdp_randomlistingswidget
wpbdp-show-tracking-pointer
db_upgraded
wpbdp-db-version
...

Browser metrics Passed 4 tests

An overview of browser requirements for Business Directory Plugin - Easy Listing Directories for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16214.28 ▼0.281.69 ▲0.0943.38 ▲1.76
Dashboard /wp-admin2,329 ▲1495.75 ▲0.1191.77 ▲4.9941.19 ▼2.06
Posts /wp-admin/edit.php2,229 ▲1322.32 ▲0.3241.48 ▲7.2536.63 ▼1.42
Add New Post /wp-admin/post-new.php1,583 ▲5721.97 ▼1.14617.54 ▼97.9552.01 ▼5.68
Media Library /wp-admin/upload.php1,476 ▲764.21 ▲0.1298.64 ▼19.1446.38 ▼3.30
Settings /wp-admin/admin.php?page=wpbdp_settings1,4522.6942.7766.32
Directory Tags /wp-admin/edit-tags.php?taxonomy=wpbdp_tag&post_type=wpbdp_listing1,5752.1630.8535.15
Themes /wp-admin/admin.php?page=wpbdp-themes1,2622.7245.6131.45
Directory /wp-admin/admin.php?page=wpbdp_admin1,1362.6836.5621.99
Directory Content /wp-admin/edit.php?post_type=wpbdp_listing1,7643.1152.5968.09
Import & Export /wp-admin/admin.php?page=wpbdp_admin_csv2,0732.7846.9045.43
Modules /wp-admin/admin.php?page=wpbdp-addons1,5622.6538.5877.13
Plans /wp-admin/admin.php?page=wpbdp-admin-fees1,8783.1967.6745.89
SMTP /wp-admin/admin.php?page=wpbdp-smtp1,3612.6438.6370.53
Payment History /wp-admin/admin.php?page=wpbdp_admin_payments1,3602.7343.0925.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_wpbdp_listings
    • wp_wpbdp_form_fields
    • wp_wpbdp_logs
    • wp_wpbdp_payments
    • wp_wpbdp_plans
  • Zombie WordPress options detected upon uninstall: 15 options
    • db_upgraded
    • can_compress_scripts
    • widget_wpbdp_featuredlistingswidget
    • widget_recent-posts
    • widget_wpbdp_latestlistingswidget
    • widget_wpbdp_randomlistingswidget
    • wpbdp-show-tracking-pointer
    • wpbdp_settings
    • wpbdp-db-version
    • wpbdp-show-drip-pointer
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=wpbdp_tag&post_type=wpbdp_listing
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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 fix the following
  • 16× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/business-directory-plugin/includes/models/class-install-plugin.php
    • > /wp-content/plugins/business-directory-plugin/includes/admin/views/modules/list.php
    • > /wp-content/plugins/business-directory-plugin/includes/controllers/class-addons.php
    • > /wp-content/plugins/business-directory-plugin/templates/submit-listing-rootline.tpl.php
    • > /wp-content/plugins/business-directory-plugin/includes/admin/helpers/class-modules-api.php
    • > /wp-content/plugins/business-directory-plugin/includes/admin/helpers/csv/class-csv-import.php
    • > /wp-content/plugins/business-directory-plugin/templates/admin/metaboxes-listing-timeline.tpl.php
    • > /wp-content/plugins/business-directory-plugin/includes/helpers/class-currency-helper.php
    • > /wp-content/plugins/business-directory-plugin/includes/helpers/class-app.php
    • > /wp-content/plugins/business-directory-plugin/includes/admin/views/review.php
  • 398× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/business-directory-plugin/templates/deprecated/search.tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/business-directory-plugin/includes/seo.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPBDP__Migration' not found in wp-content/plugins/business-directory-plugin/includes/admin/upgrades/migrations/migration-8_0.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'WPBDP_PATHincludes/widgets/class-listings-widget.php' (include_path='.:/usr/share/php') in wp-content/plugins/business-directory-plugin/includes/widgets/widget-latest-listings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WPBDP__Migration' not found in wp-content/plugins/business-directory-plugin/includes/admin/upgrades/migrations/migration-12_0.php:3
    • > PHP Warning
      require_once(WPBDP_INCadmin/helpers/csv/class-csv-import.php): failed to open stream: No such file or directory in wp-content/plugins/business-directory-plugin/includes/admin/csv-import.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpbdp_admin_header() in wp-content/plugins/business-directory-plugin/templates/admin/fees-add-fee.tpl.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'WPBDP_PATHincludes/helpers/class-authenticated-listing-view.php' (include_path='.:/usr/share/php') in wp-content/plugins/business-directory-plugin/includes/controllers/pages/class-submit-listing.php on line 8
    • > PHP Warning
      require_once(WPBDP_PATHincludes/widgets/class-listings-widget.php): failed to open stream: No such file or directory in wp-content/plugins/business-directory-plugin/includes/widgets/widget-featured-listings.php on line 2
    • > PHP Warning
      Use of undefined constant WPBDP_PATH - assumed 'WPBDP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-directory-plugin/includes/db/class-db-model.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
You can look at the official readme.txt

business-directory-plugin/business-directory-plugin.php Passed 13 tests

The main PHP script in "Business Directory Plugin - Easy Listing Directories for WordPress" version 6.3.10 is automatically included on every request by WordPress
98 characters long description:
Provides the ability to maintain a free or paid business directory on your WordPress powered site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected101,530 lines of code in 525 files:
LanguageFilesBlank linesComment linesLines of code
PO File915,31322,06648,899
PHP3599,4927,43240,596
JavaScript982,3771,26310,349
CSS145828610
Markdown81930501
HTML1270331
SVG3311208
JSON21027
XML1009

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity24.45
▷ Minimum class complexity1.00
▷ Maximum class complexity278.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes221
▷ Abstract classes20.90%
▷ Concrete classes21999.10%
▷ Final classes62.74%
Methods2,140
▷ Static methods24411.40%
▷ Public methods1,59774.63%
▷ Protected methods984.58%
▷ Private methods44520.79%
Functions173
▷ Named functions16494.80%
▷ Anonymous functions95.20%
Constants37
▷ Global constants1232.43%
▷ Class constants2567.57%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/menuico.png3.35KB0.96KB▼ 71.46%
assets/images/smtp-screenshot-tnail.png23.41KB24.58KB0.00%
assets/images/paypal-gateway-module.png21.64KB9.91KB▼ 54.23%
assets/images/payfast-payment-module.png8.48KB3.25KB▼ 61.74%
assets/images/linkedin.png3.63KB1.22KB▼ 66.42%