72% phone-directory

Code Review | Simple Business Directory with Maps

WordPress plugin Simple Business Directory with Maps scored72%from 54 tests.

About plugin

  • Plugin page: phone-directory
  • Plugin version: 6.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jun 8, 2017
  • Latest release: Nov 24, 2023
  • Number of updates: 128
  • Update frequency: every 18.5 days
  • Top authors: quantumcloud (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

600+ active /47,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.88MB] [CPU: ▲5.89ms] Passed 4 tests

An overview of server-side resources used by Simple Business Directory with Maps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8444.98 ▲3.30
Dashboard /wp-admin4.20 ▲0.8954.84 ▲10.37
Posts /wp-admin/edit.php4.25 ▲0.9055.74 ▲4.53
Add New Post /wp-admin/post-new.php6.82 ▲0.9399.83 ▲5.37
Media Library /wp-admin/upload.php4.13 ▲0.9043.25 ▲11.45
Support /wp-admin/edit.php?post_type=pnd&page=qcopd_sbd_supports4.1040.29
Settings /wp-admin/edit.php?post_type=pnd&page=sbd_settings4.1040.52
Import /wp-admin/edit.php?post_type=pnd&page=qcpnd_bimport_page4.0937.24
Manage List Items /wp-admin/edit.php?post_type=pnd4.1745.28
List Categories /wp-admin/edit-tags.php?taxonomy=pnd_cat&post_type=pnd4.2442.42
New List /wp-admin/post-new.php?post_type=pnd4.3357.53

Server storage [IO: ▲10.52MB] [DB: ▲0.18MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 337 new files
Database: no new tables, 8 new options
New WordPress options
sbd_ot_convrt
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
pdhclpage
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Simple Business Directory with Maps
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲22815.05 ▲0.806.46 ▲4.6227.76 ▼20.35
Dashboard /wp-admin2,262 ▲826.01 ▲0.41125.26 ▲34.4971.79 ▲27.48
Posts /wp-admin/edit.php2,176 ▲732.87 ▲0.9350.98 ▲13.5336.40 ▲0.77
Add New Post /wp-admin/post-new.php6,440 ▲4,91429.36 ▲6.24919.03 ▲263.5740.82 ▼12.19
Media Library /wp-admin/upload.php1,479 ▲765.45 ▲1.24107.62 ▲7.9284.75 ▲42.63
Support /wp-admin/edit.php?post_type=pnd&page=qcopd_sbd_supports1,7463.2260.1972.03
Settings /wp-admin/edit.php?post_type=pnd&page=sbd_settings2,0273.1257.0058.44
Import /wp-admin/edit.php?post_type=pnd&page=qcpnd_bimport_page1,1472.8949.8054.69
Manage List Items /wp-admin/edit.php?post_type=pnd1,3443.3756.2043.16
List Categories /wp-admin/edit-tags.php?taxonomy=pnd_cat&post_type=pnd1,3562.7140.0533.81
New List /wp-admin/post-new.php?post_type=pnd2,2405.20104.63115.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • pdhclpage
    • sbd_ot_convrt
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 11× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/phone-directory/qc-opd-setting-option.php
    • > /wp-content/plugins/phone-directory/qc-op-directory-post-type.php
    • > /wp-content/plugins/phone-directory/qc-op-directory-import.php
    • > /wp-content/plugins/phone-directory/qc-op-directory-assets.php
    • > /wp-content/plugins/phone-directory/qcpnd-shortcode-generator.php
    • > /wp-content/plugins/phone-directory/qc-opd-sorting-support.php
    • > /wp-content/plugins/phone-directory/qc-opd-setting-options.php
    • > /wp-content/plugins/phone-directory/class-qc-free-plugin-upgrade-notice.php
    • > /wp-content/plugins/phone-directory/qc-op-directory-info-page.php
    • > /wp-content/plugins/phone-directory/qc-op-directory-main.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant qcpnd_IMG_URL - assumed 'qcpnd_IMG_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/phone-directory/qc-rating-feature/qc-rating-class.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/phone-directory/templates/style-2/template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/phone-directory/templates/simple/template.php:5
    • > PHP Notice
      Undefined variable: filterorderby in wp-content/plugins/phone-directory/templates/maponly/filter-template.php on line 6
    • > PHP Notice
      Undefined variable: borderClass in wp-content/plugins/phone-directory/templates/maponly/search-template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/phone-directory/embed/embedder.php:7
    • > PHP Notice
      Undefined variable: searchSettings in wp-content/plugins/phone-directory/templates/maponly/search-template.php on line 3
    • > PHP Notice
      Undefined variable: filterorder in wp-content/plugins/phone-directory/templates/maponly/filter-template.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/phone-directory/templates/style-3/template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pd_ot_get_option() in wp-content/plugins/phone-directory/templates/maponly/search-template.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pnd
    • > Console-api (warning) in unknown
    https://maps.google.com/maps/api/js?key=AIzaSyBACyZ4vA8pQybj9ZdZP-J5zQHqfQkqOXY&libraries=geometry,places 249: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"

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: directory, store locator, staff directory, company directory, business directory

phone-directory/qc-op-directory-main.php 77% from 13 tests

The main file in "Simple Business Directory with Maps" v. 6.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("phone-directory.php" instead of "qc-op-directory-main.php")
  • Description: The description should be shorter than 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected39,876 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
CSS3686530318,096
JSON9007,252
JavaScript741,9031,6447,209
PHP311,6726834,431
SVG5102,703
Markdown235089
Bourne Shell124055
Sass34141

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.18
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes13.57%
▷ Concrete classes2796.43%
▷ Final classes00.00%
Methods139
▷ Static methods21.44%
▷ Public methods13496.40%
▷ Protected methods10.72%
▷ Private methods42.88%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.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
85 PNG files occupy 2.45MB with 1.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
qc-support-promo-page/images/slider-hero-icon-256x256.png71.55KB20.25KB▼ 71.70%
qc-support-promo-page/images/comment-link-remove.png33.90KB12.09KB▼ 64.34%
inc/cmb/css/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
qc-support-promo-page/images/feature04.png6.35KB2.85KB▼ 55.08%
assets/images/phonedirectory.png1.48KB0.84KB▼ 43.39%