84% ds-directory

Code Review | DS Directory

WordPress plugin DS Directory scored84%from 54 tests.

About plugin

  • Plugin page: ds-directory
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2022
  • Latest release: Apr 17, 2023
  • Number of updates: 5
  • Update frequency: every 73.6 days
  • Top authors: divspot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /658 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.19ms] Passed 4 tests

A check of server-side resources used by DS Directory
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1439.48 ▼2.97
Dashboard /wp-admin3.46 ▲0.1655.75 ▲4.59
Posts /wp-admin/edit.php3.52 ▲0.1651.29 ▲2.76
Add New Post /wp-admin/post-new.php6.05 ▲0.1686.36 ▼9.16
Media Library /wp-admin/upload.php3.39 ▲0.1641.40 ▲6.76
All directory items /wp-admin/edit.php?post_type=dsdi_item3.4335.38
Add New /wp-admin/post-new.php?post_type=dsdi_item3.5355.54
Directories /wp-admin/edit-tags.php?taxonomy=ds_directory&post_type=dsdi_item3.3940.73
Settings /wp-admin/edit.php?post_type=dsdi_item&page=ds-directory3.5136.67

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 45 new files
Database: no new tables, 10 new options
New WordPress options
ds_directory_children
widget_recent-posts
dsdi_version
default_ds_directory
db_upgraded
widget_recent-comments
dsdi_settings
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for DS Directory
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.30 ▼0.291.62 ▼0.0044.68 ▲0.03
Dashboard /wp-admin2,217 ▲405.65 ▼0.0484.22 ▼5.1369.33 ▲23.79
Posts /wp-admin/edit.php2,137 ▲342.00 ▼0.0039.30 ▼0.4035.73 ▲1.83
Add New Post /wp-admin/post-new.php1,555 ▲2117.50 ▼5.88771.18 ▲173.8855.93 ▲1.67
Media Library /wp-admin/upload.php1,425 ▲284.25 ▲0.0399.90 ▼1.5966.15 ▲20.60
All directory items /wp-admin/edit.php?post_type=dsdi_item1,1151.9430.5729.40
Add New /wp-admin/post-new.php?post_type=dsdi_item2,4328.10217.29129.36
Directories /wp-admin/edit-tags.php?taxonomy=ds_directory&post_type=dsdi_item1,4062.1526.9135.38
Settings /wp-admin/edit.php?post_type=dsdi_item&page=ds-directory2,3774.40144.8756.07

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
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • ds_directory_children
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • default_ds_directory

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_term_by() in wp-content/plugins/ds-directory/templates/directories-header.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'DS_DIRECTORY' not found in wp-content/plugins/ds-directory/templates/dsdi_item.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'DS_DIRECTORY' not found in wp-content/plugins/ds-directory/inc/dynamic-styles.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: catalog, mall directory, car directory, services, directory...

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

"DS Directory" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
119 characters long description:
DS Directory adds to your WordPress installation a clean and flexible directory (e.g. Shops, Services, Products, Cars).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin5,803 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
CSS45541512,078
Sass937751,997
PHP131513521,469
JavaScript454100244
SVG10015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity26.00
▷ Minimum class complexity24.00
▷ Maximum class complexity28.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods413.33%
▷ Public methods2893.33%
▷ Protected methods00.00%
▷ Private methods26.67%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-xs.png3.05KB0.62KB▼ 79.64%