83% sirve

Code Review | Sirve - Simple Directory Listing

WordPress plugin Sirve - Simple Directory Listing scored83%from 54 tests.

About plugin

  • Plugin page: sirve
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 30, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 16
  • Update frequency: every 45.0 days
  • Top authors: hasthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /716 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.83ms] 75% from 4 tests

A check of server-side resources used by Sirve - Simple Directory Listing
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,395.59ms on /wp-admin/edit.php?post_type=sirve&page=sirve-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1842.86 ▼2.69
Dashboard /wp-admin3.46 ▲0.1148.36 ▼10.61
Posts /wp-admin/edit.php3.52 ▲0.1649.27 ▲4.99
Add New Post /wp-admin/post-new.php6.23 ▲0.3493.89 ▲0.99
Media Library /wp-admin/upload.php3.38 ▲0.1542.42 ▲11.16
Tags /wp-admin/edit-tags.php?taxonomy=sirve_tag&post_type=sirve3.4742.05
Settings /wp-admin/edit.php?post_type=sirve&page=sirve-settings3.3641.43
Recommendations /wp-admin/edit.php?post_type=sirve&page=sirve-recommendations7.681,395.59
Add Listing /wp-admin/post-new.php?post_type=sirve6.2585.39
Types /wp-admin/edit-tags.php?taxonomy=sirve_event&post_type=sirve3.3836.03
Categories /wp-admin/edit-tags.php?taxonomy=sirve_category&post_type=sirve3.4439.79
All Listings /wp-admin/edit.php?post_type=sirve3.4435.15

Server storage [IO: ▲0.34MB] [DB: ▲0.68MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Sirve - Simple Directory Listing
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10214.28 ▼0.042.15 ▲0.4940.38 ▼1.82
Dashboard /wp-admin2,238 ▲615.52 ▲0.0296.33 ▲6.5070.48 ▲33.85
Posts /wp-admin/edit.php2,160 ▲602.02 ▲0.0138.75 ▼3.8834.57 ▼2.50
Add New Post /wp-admin/post-new.php1,598 ▲7223.73 ▲0.60665.81 ▼23.1443.48 ▼13.83
Media Library /wp-admin/upload.php1,448 ▲514.23 ▲0.1396.36 ▼4.8974.91 ▲28.13
Tags /wp-admin/edit-tags.php?taxonomy=sirve_tag&post_type=sirve1,9836.77144.2196.82
Settings /wp-admin/edit.php?post_type=sirve&page=sirve-settings2,7003.1195.8934.02
Recommendations /wp-admin/edit.php?post_type=sirve&page=sirve-recommendations2,9732.1840.5682.61
Add Listing /wp-admin/post-new.php?post_type=sirve6,39419.92801.8569.58
Types /wp-admin/edit-tags.php?taxonomy=sirve_event&post_type=sirve1,3392.1730.3329.84
Categories /wp-admin/edit-tags.php?taxonomy=sirve_category&post_type=sirve2,0156.64129.08101.74
All Listings /wp-admin/edit.php?post_type=sirve1,2242.2434.2032.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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 | 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 fix the following
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sirve/frontend/templates/event-archive-layout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sirve/admin/include/custom-meta-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/sirve/frontend/templates/sirve-full-width-page-template.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Sirve\\Admin\\Recommended_Plugins' not found in wp-content/plugins/sirve/admin/classes/class.recommended_plugins_menu_call.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_queried_object() in wp-content/plugins/sirve/frontend/templates/archive-category.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sirve/frontend/templates/tags-archive-layout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sirve/frontend/templates/archive-layout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sirve/admin/classes/class.admin-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_queried_object() in wp-content/plugins/sirve/frontend/templates/archive-tags.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sirve/admin/classes/class.custom-post-type.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Screenshot #10 (Gutenberg editor) image missing
You can look at the official readme.txt

sirve/sirve.php Passed 13 tests

"Sirve - Simple Directory Listing" version 1.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
85 characters long description:
Enables you to easily manage your product and service listings with tons of features.

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
Success! There were no dangerous files found in this plugin3,948 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP214792812,836
CSS21076803
JavaScript45480307
SVG2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity16.88
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods56
▷ Static methods47.14%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/extensions/htmega-pro.png4.60KB4.78KB0.00%
admin/assets/images/extensions/ht-script-pro.png6.03KB2.71KB▼ 55.09%
(invalid) admin/assets/images/extensions/docus-pro.png3.98KB0.00KB▼ 100.00%
(invalid) admin/assets/images/extensions/cf7-extensions-pro.png8.57KB0.00KB▼ 100.00%
admin/assets/images/extensions/swatchly-pro.png13.99KB5.41KB▼ 61.37%