64% multisite-directory

Code Review | Multisite Directory

WordPress plugin Multisite Directory scored64%from 54 tests.

About plugin

  • Plugin page: multisite-directory
  • Plugin version: 0.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Mar 30, 2016
  • Latest release: Jun 16, 2017
  • Number of updates: 72
  • Update frequency: every 6.2 days
  • Top authors: meitar (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /4,390 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.85ms] Passed 4 tests

An overview of server-side resources used by Multisite Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.47 ▲2.74
Dashboard /wp-admin3.31 ▲0.0050.18 ▼2.68
Posts /wp-admin/edit.php3.36 ▲0.0051.04 ▼0.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.28 ▼29.40
Media Library /wp-admin/upload.php3.23 ▲0.0040.55 ▲1.35

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Multisite Directory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▲0.021.76 ▲0.0445.42 ▲5.32
Dashboard /wp-admin2,192 ▲155.53 ▼0.1892.42 ▼2.5339.71 ▼5.72
Posts /wp-admin/edit.php2,103 ▼02.10 ▲0.0842.04 ▼1.3036.40 ▼0.12
Add New Post /wp-admin/post-new.php1,541 ▲1523.03 ▲0.13632.82 ▼43.1350.25 ▼5.06
Media Library /wp-admin/upload.php1,397 ▼64.21 ▼0.02108.01 ▲2.5744.28 ▼5.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/multisite-directory/multisite-directory.php+73
    Uncaught Error: Class 'Multisite_Directory_Taxonomy' not found in wp-content/plugins/multisite-directory/multisite-directory.php:73
    Stack trace:
    #0 wp-content/plugins/multisite-directory/uninstall.php(14): WP_Multisite_Directory::initialize()
    #1 wp-admin/includes/plugin.php(1245): include_once('/var/www/wordpr...')
    #2 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • Incomplete uninstall procedure, leaving 54 files (0.58MB) in the plugin directory
    • (new file) .bowerrc
    • (new file) admin/class-multisite-directory-admin.php
    • (new file) admin/partials/.empty
    • (new file) admin/index.php
    • (new file) .travis.yml
    • (new file) README.md
    • (new file) admin/js/multisite-directory-admin.js
    • (new file) LICENSE.txt
    • (new file) bin/install-wp-tests.sh
    • (new file) admin/css/.empty
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/multisite-directory/tests/bootstrap.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/multisite-directory/tests/bootstrap.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/multisite-directory/tests/test-shortcode.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/multisite-directory/tests/test-directory.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/multisite-directory/includes/class-multisite-directory-widget.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: posts, taxonomy, network, multisite

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

The main PHP file in "Multisite Directory" ver. 0.2.3 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
Adds a Network-wide site directory to your WP Multisite network.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected9,523 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,1895376,586
PHP121736981,032
Markdown52910997
CSS24718420
PO File36877209
JSON600147
Bourne Shell119693
YAML17025
XML10014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.45
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods63
▷ Static methods2946.03%
▷ Public methods5688.89%
▷ Protected methods00.00%
▷ Private methods711.11%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/leaflet/dist/images/layers.png1.47KB1.05KB▼ 28.36%
vendor/leaflet/dist/images/layers-2x.png2.83KB1.67KB▼ 41.10%
vendor/leaflet/dist/images/marker-icon-2x.png3.94KB2.53KB▼ 35.71%
vendor/leaflet/dist/images/marker-shadow.png0.78KB1.16KB0.00%
vendor/leaflet/dist/images/marker-icon.png1.71KB1.56KB▼ 8.59%