79% store-directory

Code Review | Store Directory

WordPress plugin Store Directory scored79%from 54 tests.

About plugin

  • Plugin page: store-directory
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Jan 2, 2014
  • Latest release: Jan 3, 2014
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: mboynes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,860 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.11ms] Passed 4 tests

An overview of server-side resources used by Store Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.45 ▼8.36
Dashboard /wp-admin3.37 ▲0.0756.35 ▲2.93
Posts /wp-admin/edit.php3.49 ▲0.1351.15 ▼3.52
Add New Post /wp-admin/post-new.php5.96 ▲0.0785.36 ▼12.64
Media Library /wp-admin/upload.php3.29 ▲0.0736.33 ▲0.09
Add New /wp-admin/post-new.php?post_type=store3.3463.70
Stores /wp-admin/edit.php?post_type=store3.3434.55

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Store Directory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲19414.29 ▼0.0631.31 ▲29.2539.41 ▼18.17
Dashboard /wp-admin2,222 ▲425.64 ▲0.0794.32 ▲0.5041.59 ▲0.05
Posts /wp-admin/edit.php2,127 ▲272.01 ▲0.0633.10 ▼10.6737.32 ▼4.14
Add New Post /wp-admin/post-new.php1,558 ▲2918.52 ▼4.46615.94 ▲1.8467.38 ▲18.46
Media Library /wp-admin/upload.php1,430 ▲274.16 ▼0.0597.78 ▼6.6540.91 ▼3.92
Add New /wp-admin/post-new.php?post_type=store1,5153.5773.3870.78
Stores /wp-admin/edit.php?post_type=store1,1001.9630.8831.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_wpsd_widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-directory/lib/admin.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/store-directory/lib/class-wpsd-widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/store-directory/store-directory.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-directory/lib/class-wpsd-search.php:147
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-directory/lib/class-wpsd-post-meta.php:122
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/store-directory/lib/class-wpsd-post-type.php:75

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=store
    • > Console-api (warning) in unknown
    http://maps.google.com/maps/api/js?sensor=false&ver=1.0 210: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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: location, directory, store, google maps, maps

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

Analyzing the main PHP file in "Store Directory" version 0.1
45 characters long description:
A simple plugin for keeping a store directory

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 plugin457 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP78488354
JavaScript1145103

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.50
▷ Minimum class complexity3.00
▷ Maximum class complexity19.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods3191.18%
▷ Protected methods00.00%
▷ Private methods38.82%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin