72% smooth-directory

Code Review | Smooth Directory

WordPress plugin Smooth Directory scored72%from 54 tests.

About plugin

  • Plugin page: smooth-directory
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.3
  • WordPress version: 6.3.1
  • First release: Dec 9, 2015
  • Latest release: Sep 8, 2016
  • Number of updates: 8
  • Update frequency: every 34.2 days
  • Top authors: hetzelcreative (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,486 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.28ms] Passed 4 tests

This is a short check of server-side resources used by Smooth Directory
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1636.37 ▼5.23
Dashboard /wp-admin3.53 ▲0.1851.80 ▼10.24
Posts /wp-admin/edit.php3.58 ▲0.2355.03 ▲7.01
Add New Post /wp-admin/post-new.php6.05 ▲0.1692.66 ▼1.60
Media Library /wp-admin/upload.php3.37 ▲0.1443.23 ▲3.96
Settings /wp-admin/edit.php?post_type=businesses&page=smooth-directory-settings3.3735.81
Categories /wp-admin/edit-tags.php?taxonomy=business_category&post_type=businesses3.3939.60
Add New Business /wp-admin/post-new.php?post_type=businesses3.4549.81
Businesses /wp-admin/edit.php?post_type=businesses3.4441.82

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smooth Directory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,051 ▲29014.96 ▲0.234.94 ▲3.1841.29 ▼4.31
Dashboard /wp-admin2,371 ▲1916.22 ▲0.56109.63 ▲11.2138.62 ▼2.58
Posts /wp-admin/edit.php2,296 ▲1963.36 ▲1.3351.44 ▲17.1431.83 ▼3.11
Add New Post /wp-admin/post-new.php1,562 ▲3123.26 ▲2.31621.76 ▼8.2136.88 ▼19.19
Media Library /wp-admin/upload.php1,439 ▲394.27 ▲0.0879.04 ▼16.3239.66 ▼1.57
Settings /wp-admin/edit.php?post_type=businesses&page=smooth-directory-settings1,0253.0638.3925.87
Categories /wp-admin/edit-tags.php?taxonomy=business_category&post_type=businesses1,4763.2239.7130.24
Add New Business /wp-admin/post-new.php?post_type=businesses1,9353.6964.3934.16
Businesses /wp-admin/edit.php?post_type=businesses1,2753.3543.4827.77

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/smooth-directory/public/partials/smooth-directory-public-display.php
    • > /wp-content/plugins/smooth-directory/admin/partials/smooth-directory-admin-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function locate_template() in wp-content/plugins/smooth-directory/public/taxonomy-business_category.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/smooth-directory/admin/partials/smooth-directory-admin-display-metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/smooth-directory/admin/partials/smooth-directory-admin-options.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function locate_template() in wp-content/plugins/smooth-directory/public/archive-businesses.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/smooth-directory/public/partials/filter-row.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=businesses
    • > Console-api (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:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/smooth-directory/admin/js/smooth-directory-admin.js?ver=1.0.0:5:42)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=businesses
    • > Javascript (severe) 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:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === smooth-directory === )
You can take inspiration from this readme.txt

smooth-directory/smooth-directory.php Passed 13 tests

The principal PHP file in "Smooth Directory" v. 1.2.3 is loaded by WordPress automatically on each request
47 characters long description:
A simple and flexible business directory plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin932 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP17223655787
CSS2228105
Markdown117028
JavaScript22012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.86
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods3186.11%
▷ Protected methods00.00%
▷ Private methods513.89%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.58MB with 0.28MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png206.27KB79.58KB▼ 61.42%
assets/banner-772x250.png2.22KB1.69KB▼ 23.67%
assets/banner-1544x500.png4.36KB2.03KB▼ 53.44%
assets/screenshot-1.png381.31KB160.66KB▼ 57.87%