10% bdwp-business-directory

Code Review | Business Directory for WordPress

WordPress plugin Business Directory for WordPress scored 10% from 54 tests.

About plugin

  • Plugin page: bdwp-business-dir...
  • Plugin version: 0.7.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Sep 14, 2017
  • Latest release: Apr 12, 2018
  • Number of updates: 43
  • Update frequency: every 5.6 days
  • Top authors: dmhgr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,316 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/bdwp-business-directory/bdwp.php+54
    Trying to get property 'is_single' of non-object

Server metrics [RAM: ▼1.36MB] [CPU: ▼51.09ms] Passed 4 tests

An overview of server-side resources used by Business Directory for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.63 ▼0.848.33 ▼39.01
Dashboard /wp-admin2.65 ▼0.6611.00 ▼35.30
Posts /wp-admin/edit.php2.65 ▼0.719.66 ▼39.86
Add New Post /wp-admin/post-new.php2.65 ▼3.2411.03 ▼90.17
Media Library /wp-admin/upload.php2.65 ▼0.5910.91 ▼22.05
Business Directory /wp-admin/options-general.php?page=bdwp-settings2.6512.05

Server storage [IO: ▲2.73MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • Illegal file modification detected: 1 file (0.04KB) outside of "wp-content/plugins/bdwp-business-directory/" and "wp-content/uploads/"
    • (new file) robots.txt
Filesystem: 250 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
bdwp-sitemap-updated-at
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
bdwp_received_services

Browser metrics Passed 4 tests

Checking browser requirements for Business Directory for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.24 ▼1.131.61 ▼0.0739.93 ▼1.66
Dashboard /wp-admin2,210 ▲254.83 ▼0.20110.13 ▲1.0640.56 ▼6.34
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0438.13 ▼1.7835.16 ▼1.32
Add New Post /wp-admin/post-new.php1,537 ▲421.03 ▼2.14666.40 ▼10.3056.94 ▲1.88
Media Library /wp-admin/upload.php1,386 ▲44.17 ▲0.0296.54 ▼6.0441.55 ▲0.22
Business Directory /wp-admin/options-general.php?page=bdwp-settings4,2734.7383.5431.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/bdwp-business-directory/bdwp.php+54
    Trying to get property 'is_single' of non-object
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • bdwp-sitemap-updated-at
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • bdwp_received_services

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=bdwp-settings
    • > Notice in wp-content/plugins/bdwp-business-directory/bdwp.php+54
    Trying to get property 'is_single' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bdwp-settings
    • > Notice in wp-content/plugins/bdwp-business-directory/lib/option.php+203
    Trying to access array offset on value of type null

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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bdwp-business-directory/mustache/bin/build_bootstrap.php
  • 58× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Test_SpecTestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Cache_AbstractCache' not found in wp-content/plugins/bdwp-business-directory/mustache/src/Mustache/Cache/NoopCache.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Test_SpecTestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/Functional/InheritanceTest.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Cache' not found in wp-content/plugins/bdwp-business-directory/mustache/src/Mustache/Cache/AbstractCache.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Cache_AbstractCache' not found in wp-content/plugins/bdwp-business-directory/mustache/src/Mustache/Cache/FilesystemCache.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Logger_AbstractLogger' not found in wp-content/plugins/bdwp-business-directory/mustache/src/Mustache/Logger/StreamLogger.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Test_FunctionalTestCase' not found in wp-content/plugins/bdwp-business-directory/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php:16

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: business directory

bdwp-business-directory/bdwp.php 92% from 13 tests

The main file in "Business Directory for WordPress" v. 0.7.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bdwp-business-directory.php" instead of "bdwp.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .ms - Maxwell Script in Maxwell Render
      • wp-content/plugins/bdwp-business-directory/mustache/test/fixtures/templates/alpha.ms
      • wp-content/plugins/bdwp-business-directory/mustache/test/fixtures/templates/beta.ms
31,518 lines of code in 202 files:
LanguageFilesBlank linesComment linesLines of code
CSS8974310,961
PHP1211,6373,5358,084
JavaScript161,4074586,681
SVG2002,928
Sass121601,170
JSON300820
Mustache4310703
Markdown237070
INI21060
YAML25023
XML23018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.33
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces5
Traits0
Classes124
▷ Abstract classes64.84%
▷ Concrete classes11895.16%
▷ Final classes00.00%
Methods522
▷ Static methods366.90%
▷ Public methods45887.74%
▷ Protected methods193.64%
▷ Private methods458.62%
Functions139
▷ Named functions7151.08%
▷ Anonymous functions6848.92%
Constants70
▷ Global constants68.57%
▷ Class constants6491.43%
▷ Public constants64100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin