Benchmarks
Plugin footprint 40% from 16 tests
Installer 0% from 1 test
🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
- The plugin did not install without errors
- > Warning in wp-content/plugins/wp-businessdirectory/site/helpers/utils.php+441
Invalid argument supplied for foreach()
Server metrics [RAM: ▼2.21MB] [CPU: ▼340.57ms] Passed 4 tests
Analyzing server-side resources used by WP-BusinessDirectory
Server-side resource usage in normal parameters
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 2.16 ▼1.36 | 7.04 ▼42.42 |
Dashboard /wp-admin | 2.18 ▼1.23 | 5.44 ▼28.69 |
Posts /wp-admin/edit.php | 2.18 ▼1.46 | 6.09 ▼32.77 |
Add New Post /wp-admin/post-new.php | 2.18 ▼4.79 | 5.89 ▼1,258.38 |
Media Library /wp-admin/upload.php | 2.18 ▼1.12 | 5.40 ▼25.73 |
Widgets /wp-admin/widgets.php | 2.18 | 5.49 |
Menus /wp-admin/nav-menus.php | 2.19 | 6.91 |
Server storage [IO: ▲48.83MB] [DB: ▲0.42MB] 67% from 3 tests
Analyzing filesystem and database footprints of this plugin
These are issues you should consider
- Total filesystem usage should be limited to 25MB (currently using 48.83MB)
Filesystem: 3,357 new files
Database: 127 new tables, 13 new options
New tables |
---|
wp_jbusinessdirectory_shipping_methods |
wp_jbusinessdirectory_language_translations |
wp_jbusinessdirectory_attribute_category |
wp_jbusinessdirectory_mobile_devices |
wp_jbusinessdirectory_categories |
wp_jbusinessdirectory_orders |
wp_jbusinessdirectory_company_projects |
wp_jbusinessdirectory_statistics_archive |
wp_jbusinessdirectory_attribute_types |
wp_jbusinessdirectory_company_editors |
... |
New WordPress options |
---|
wpbd_db_version |
widget_wp_businessdirectory_search_events_widget |
widget_wp_businessdirectory_users_widget |
widget_wp_businessdirectory_categories_events_widget |
widget_wp_businessdirectory_search_offers_widget |
widget_wp_businessdirectory_categories_widget |
businessdirectory_admin_notices |
widget_wp_businessdirectory_listings_widget |
widget_wp_businessdirectory_categories_offers_widget |
widget_wp_businessdirectory_offers_widget |
... |
Browser metrics Passed 4 tests
An overview of browser requirements for WP-BusinessDirectory
Normal browser usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 4,034 ▲280 | 17.26 ▲1.35 | 20.49 ▲14.97 | 2.55 ▲0.15 |
Dashboard /wp-admin | 2,990 ▲132 | 6.15 ▼0.19 | 111.82 ▼20.60 | 182.62 ▲25.04 |
Posts /wp-admin/edit.php | 2,788 ▲94 | 3.25 ▲0.01 | 63.24 ▲0.64 | 139.99 ▼1.49 |
Add New Post /wp-admin/post-new.php | 1,811 ▲53 | 22.06 ▲0.06 | 428.93 ▲14.63 | 187.54 ▲32.88 |
Media Library /wp-admin/upload.php | 1,797 ▲99 | 5.54 ▲0.03 | 121.80 ▼11.81 | 199.44 ▲7.41 |
Widgets /wp-admin/widgets.php | 2,562 | 24.05 | 501.97 | 167.04 |
Menus /wp-admin/nav-menus.php | 3,546 | 3.38 | 84.10 | 141.60 |
Uninstaller [IO: ▲16.39MB] [DB: ▲0.01MB] 50% from 4 tests
🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
- This plugin cannot be uninstalled
- > Warning in wp-content/plugins/wp-businessdirectory/site/helpers/utils.php+441
Invalid argument supplied for foreach()
- This plugin does not fully uninstall, leaving 12 options in the database
- widget_wp_businessdirectory_users_widget
- widget_wp_businessdirectory_offers_widget
- wpbd_plugin_version
- widget_wp_businessdirectory_search_offers_widget
- widget_wp_businessdirectory_categories_events_widget
- widget_wp_businessdirectory_categories_offers_widget
- widget_wp_businessdirectory_listings_widget
- widget_wp_businessdirectory_search_events_widget
- widget_wp_businessdirectory_categories_widget
- businessdirectory_admin_notices
- ...
Smoke tests 25% from 4 tests
Server-side errors 0% from 1 test
🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
- 16 occurences, only the last one shown
- > GET request to /wp-admin/nav-menus.php
- > Warning in wp-content/plugins/wp-businessdirectory/site/helpers/utils.php+441
Invalid argument supplied for foreach()
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
The following issues need your attention
- 693× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
- > /wp-content/plugins/wp-businessdirectory/admin/models/reviewresponses.php
- > /wp-content/plugins/wp-businessdirectory/admin/controllers/offertypes.php
- > /wp-content/plugins/wp-businessdirectory/admin/tables/companytypes.php
- > /wp-content/plugins/wp-businessdirectory/admin/tables/eventtype.php
- > /wp-content/plugins/wp-businessdirectory/admin/tables/shippingmethod.php
- > /wp-content/plugins/wp-businessdirectory/admin/tables/registeredcompany.php
- > /wp-content/plugins/wp-businessdirectory/admin/views/cities/tmpl/default.php
- > /wp-content/plugins/wp-businessdirectory/admin/tables/company.php
- > /wp-content/plugins/wp-businessdirectory/admin/controllers/applicationsettings.php
- > /wp-content/plugins/wp-businessdirectory/includes/widgets/wp-businessdirectory-categories-offers/tmpl/default_boxes.php
- 159× PHP files trigger server errors when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Class 'MVC\\Application\\Cli\\Output\\Processor\\ColorProcessor' not found in wp-content/plugins/wp-businessdirectory/includes/mvc/vendor/joomla/application/src/Cli/ColorProcessor.php:19
- > PHP Fatal error
Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/psr/http-message/src/ResponseInterface.php:20
- > PHP Fatal error
Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/guzzlehttp/guzzle/src/Client.php:25
- > PHP Fatal error
Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12
- > PHP Warning
require(wp-content/plugins/wp-businessdirectory/site/libraries/vendor/league/oauth2-google/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/league/oauth2-google/examples/provider.php on line 3
- > PHP Warning
require_once(lib/byte_safe_strings.php): failed to open stream: No such file or directory in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/paragonie/random_compat/psalm-autoload.php on line 3
- > PHP Fatal error
require_once(): Failed opening required 'BD_HELPERS_PATH/defines.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-businessdirectory/includes/widgets/wp-businessdirectory-events/wp-businessdirectory-events.php on line 12
- > PHP Fatal error
require_once(): Failed opening required 'BD_HELPERS_PATH/defines.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-businessdirectory/includes/widgets/wp-businessdirectory-categories/wp-businessdirectory-categories.php on line 12
- > PHP Fatal error
Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wp-businessdirectory/site/libraries/vendor/guzzlehttp/psr7/src/DroppingStream.php:10
- > PHP Fatal error
require_once(): Failed opening required 'BD_HELPERS_PATH/defines.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-businessdirectory/includes/widgets/wp-businessdirectory-categories-offers/wp-businessdirectory-categories-offers.php on line 12
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test
Optimizations
Plugin configuration Passed 29 tests
readme.txt Passed 16 tests
It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: directory, business directory
wp-businessdirectory/wp-businessdirectory.php Passed 13 tests
"WP-BusinessDirectory" version 2.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
31 characters long description:
Professional Business Directory
Code Analysis 3% from 3 tests
File types 0% from 1 test
🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
It is important to fix the following items
- You should never include executable (binary) or otherwise dangerous files in your plugin
- .bat - Batch File in Windows
- ☣ wp-content/plugins/wp-businessdirectory/site/libraries/phpqrcode/tools/merge.bat
- .bat - Batch File in Windows
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 1,475 | 35,257 | 71,158 | 172,910 |
JavaScript | 142 | 20,988 | 21,929 | 113,241 |
INI | 49 | 15,523 | 106 | 90,035 |
CSS | 71 | 1,913 | 597 | 30,991 |
Sass | 35 | 2,605 | 5 | 13,377 |
XML | 81 | 499 | 11 | 5,109 |
Markdown | 18 | 1,381 | 0 | 3,923 |
SVG | 2 | 1 | 3 | 2,626 |
JSX | 7 | 130 | 1 | 935 |
JSON | 11 | 1 | 0 | 930 |
HTML | 5 | 5 | 4 | 117 |
make | 1 | 4 | 0 | 9 |
Bourne Shell | 3 | 3 | 0 | 7 |
DOS Batch | 1 | 0 | 0 | 2 |
PHP code 50% from 2 tests
A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
- Method cyclomatic complexity has to be reduced to less than 100 (currently 239)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.44 |
Average class complexity | 21.28 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 996.00 |
Average method complexity | 3.74 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 239.00 |
Code structure | ||
---|---|---|
Namespaces | 71 | |
Interfaces | 22 | |
Traits | 16 | |
Classes | 881 | |
▷ Abstract classes | 76 | 8.63% |
▷ Concrete classes | 805 | 91.37% |
▷ Final classes | 12 | 1.49% |
Methods | 6,876 | |
▷ Static methods | 1,360 | 19.78% |
▷ Public methods | 5,817 | 84.60% |
▷ Protected methods | 843 | 12.26% |
▷ Private methods | 216 | 3.14% |
Functions | 286 | |
▷ Named functions | 171 | 59.79% |
▷ Anonymous functions | 115 | 40.21% |
Constants | 819 | |
▷ Global constants | 655 | 79.98% |
▷ Class constants | 164 | 20.02% |
▷ Public constants | 164 | 100.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
505 PNG files occupy 3.64MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
assets/libraries/leaflet/fullscreen@2x.png | 0.41KB | 0.15KB | ▼ 63.10% |
uploads/pictures/flags/myanmar.png | 0.71KB | 0.83KB | 0.00% |
uploads/pictures/flags/canada.png | 0.56KB | 0.62KB | 0.00% |
assets/images/map_gdpr.png | 40.32KB | 14.59KB | ▼ 63.82% |
site/libraries/phpqrcode/cache/frame_14.png | 0.21KB | 0.20KB | ▼ 4.69% |