10% simple-directory

Code Review | Simple Directory

WordPress plugin Simple Directory scored10%from 54 tests.

About plugin

  • Plugin page: simple-directory
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Dec 4, 2014
  • Latest release: Jul 4, 2017
  • Number of updates: 136
  • Update frequency: every 7.0 days
  • Top authors: michaellautman (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

30+ active /19,840 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/simple-directory/inc/category-images.php+9
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.02ms] Passed 4 tests

An overview of server-side resources used by Simple Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.67 ▼2.92
Dashboard /wp-admin3.31 ▼0.0446.50 ▼17.13
Posts /wp-admin/edit.php3.36 ▲0.0042.79 ▼3.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.83 ▼20.90
Media Library /wp-admin/upload.php3.23 ▲0.0035.99 ▲1.05

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple Directory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.321.67 ▼0.1140.82 ▼3.62
Dashboard /wp-admin2,209 ▲185.86 ▼0.0294.43 ▼11.6137.89 ▼5.48
Posts /wp-admin/edit.php2,086 ▼02.06 ▲0.0435.76 ▼1.4932.89 ▼3.11
Add New Post /wp-admin/post-new.php1,542 ▲2818.24 ▲0.64610.67 ▼53.5353.71 ▲0.35
Media Library /wp-admin/upload.php1,388 ▼34.22 ▲0.0292.68 ▼7.4541.16 ▼3.00

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • SDIR_VERSION_NUM
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • sdir_version
    • 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
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-directory/parts/admin-pages/guide.php
  • 43× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-directory/parts/help/categories-help.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-directory/parts/settings/about.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/simple-directory/inc/shortcodes.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function piklist() in wp-content/plugins/simple-directory/parts/settings/category-compatibility.php:10
    • > PHP Warning
      Use of undefined constant SDIR_PLUGIN_URL - assumed 'SDIR_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-directory/inc/category-images.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-directory/parts/help/basic-settings-help.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/simple-directory/templates/single-new.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-directory/inc/category-images.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function piklist() in wp-content/plugins/simple-directory/parts/meta-boxes/primary-contact.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function piklist() in wp-content/plugins/simple-directory/parts/meta-boxes/social-profiles.php:6

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

simple-directory/simple-directory.php 85% from 13 tests

The main PHP file in "Simple Directory" ver. 2.1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin20,126 lines of code in 360 files:
LanguageFilesBlank linesComment linesLines of code
CSS58884178,220
SVG28452865,965
HTML131413,483
PHP705434812,458

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity6.40
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/img/search-widget.png32.07KB8.34KB▼ 73.99%
lib/img/sdp-banner.png24.27KB9.04KB▼ 62.73%
lib/img/icon-128x128.png3.64KB2.20KB▼ 39.60%
lib/img/recent-listings-widget.png29.55KB7.63KB▼ 74.20%