77% chamber-dashboard-business-directory

Code Review | Chamber Dashboard Business Directory

WordPress plugin Chamber Dashboard Business Directory scored 77% from 54 tests.

About plugin

  • Plugin page: chamber-dashboard...
  • Plugin version: 3.3.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2014
  • Latest release: Sep 6, 2023
  • Number of updates: 251
  • Update frequency: every 13.2 days
  • Top authors: Gwendydd (51.79%)cguntur (48.61%)

Code review

54 tests

User reviews

24 reviews

Install metrics

600+ active / 63,704 total downloads

Benchmarks

Plugin footprint 83% 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: ▲2.00MB] [CPU: ▲14.23ms] Passed 4 tests

An overview of server-side resources used by Chamber Dashboard Business Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.43 ▲1.9757.42 ▲16.32
Dashboard /wp-admin5.34 ▲2.0464.66 ▲9.51
Posts /wp-admin/edit.php5.39 ▲2.0365.20 ▲8.95
Add New Post /wp-admin/post-new.php8.08 ▲2.19117.40 ▲22.25
Media Library /wp-admin/upload.php5.17 ▲1.9558.12 ▲22.15
Welcome to Chamber Dashboard Business Directory /wp-admin/index.php?page=cdash-about5.1553.49
Support /wp-admin/admin.php?page=cd-settings&tab=support5.1763.82
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=business5.2650.53
Membership Levels /wp-admin/edit-tags.php?taxonomy=membership_level&post_type=business5.2654.73
All Businesses /wp-admin/edit.php?post_type=business5.3152.79
Add New /wp-admin/post-new.php?post_type=business8.11104.28
Getting Started /wp-admin/admin.php?page=cd-welcome5.1758.44
CD Settings /wp-admin/admin.php?page=cd-settings5.1761.21
Business Categories /wp-admin/edit-tags.php?taxonomy=business_category&post_type=business5.2651.90
Private Categories /wp-admin/edit-tags.php?taxonomy=private_category&post_type=business5.2649.52

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 322 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_cdash-search
widget_cdash-business-categories
cdash_directory_options
widget_cdash-featured
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Chamber Dashboard Business Directory
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲33815.13 ▲1.881.58 ▼0.0829.04 ▼22.95
Dashboard /wp-admin2,461 ▲2736.78 ▲1.82138.79 ▲34.5699.40 ▲57.77
Posts /wp-admin/edit.php2,386 ▲2973.89 ▲1.8857.46 ▲15.3685.20 ▲50.78
Add New Post /wp-admin/post-new.php6,734 ▲5,20125.27 ▲1.88935.03 ▲299.2937.89 ▼17.74
Media Library /wp-admin/upload.php1,517 ▲1294.53 ▲0.3088.72 ▼9.3396.35 ▲51.31
Welcome to Chamber Dashboard Business Directory /wp-admin/index.php?page=cdash-about1,95013.82365.41112.83
Support /wp-admin/admin.php?page=cd-settings&tab=support1,1303.7644.7078.05
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=business1,6083.6746.3292.38
Membership Levels /wp-admin/edit-tags.php?taxonomy=membership_level&post_type=business1,5693.6744.5283.38
All Businesses /wp-admin/edit.php?post_type=business1,4413.8649.5477.84
Add New /wp-admin/post-new.php?post_type=business3,07717.75950.7765.69
Getting Started /wp-admin/admin.php?page=cd-welcome1,91213.06315.4093.87
CD Settings /wp-admin/admin.php?page=cd-settings1,9283.7048.7385.89
Business Categories /wp-admin/edit-tags.php?taxonomy=business_category&post_type=business1,5913.7449.2170.65
Private Categories /wp-admin/edit-tags.php?taxonomy=private_category&post_type=business1,5723.6445.9382.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_cdash-search
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_cdash-business-categories
    • theysaidso_admin_options
    • widget_cdash-featured
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 55× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'P2P_Field' not found in wp-content/plugins/chamber-dashboard-business-directory/wpp2p/admin/field-delete.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'P2P_Item_Post' not found in wp-content/plugins/chamber-dashboard-business-directory/wpp2p/item-attachment.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/chamber-dashboard-business-directory/wpalchemy/busbilling.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/chamber-dashboard-business-directory/wpp2p/scb/Widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/chamber-dashboard-business-directory/includes/cd_data_erase.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/chamber-dashboard-business-directory/includes/currency_list.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/chamber-dashboard-business-directory/shortcodes/bus_cat_shortcode.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/chamber-dashboard-business-directory/wpalchemy/buscustom.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/chamber-dashboard-business-directory/wpp2p/admin/tools-page.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'P2P_Direction_Strategy' not found in wp-content/plugins/chamber-dashboard-business-directory/wpp2p/indeterminate-connection-type.php:3

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)
Please fix the following browser errors
    • > GET request to /wp-admin/index.php?page=cdash-about
    • > Network (severe)
    wp-content/plugins/chamber-dashboard-business-directory/css/images/ui-icons_444444_256x240.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=business
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&sensor=false&ver=6.3.1 208:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/edit-tags.php?taxonomy=business_category&post_type=business
    • > Deprecation (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 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (Entering business information), #2 (Business Directory admin page), #3 (Featured Business widget), #4 (Business search widget), #5 (Map of Business listings), #6 (A-Z Directory listings), #7 (Business Directory block settings)
The official readme.txt is a good inspiration

chamber-dashboard-business-directory/cdash-business-directory.php 85% from 13 tests

The entry point to "Chamber Dashboard Business Directory" version 3.3.8 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("chamber-dashboard-business-directory.php" instead of "cdash-business-directory.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected54,784 lines of code in 177 files:
LanguageFilesBlank linesComment linesLines of code
JSON51028,869
PHP1153,4653,87614,405
JavaScript248211,1435,956
CSS134052604,229
PO File1245248614
Sass1482411
HTML1290124
XML400104
Markdown234072

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.90
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes77
▷ Abstract classes1215.58%
▷ Concrete classes6584.42%
▷ Final classes00.00%
Methods655
▷ Static methods10916.64%
▷ Public methods53080.92%
▷ Protected methods8813.44%
▷ Private methods375.65%
Functions286
▷ Named functions286100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants2468.57%
▷ Class constants1131.43%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
114 PNG files occupy 4.40MB with 1.97MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/social-media/linkedin-64px.png3.02KB1.88KB▼ 37.69%
images/chamber_beautiful_theme.png370.33KB120.11KB▼ 67.57%
images/social-media/youtube-16px.png1.36KB0.56KB▼ 59.14%
Tax-meta-class/images/add.png1.84KB1.49KB▼ 19.11%
images/social-media/vimeo-32px.png2.27KB1.35KB▼ 40.29%