84% ldd-directory-lite

Code Review | LDD Directory Lite

WordPress plugin LDD Directory Lite scored84%from 54 tests.

About plugin

  • Plugin page: ldd-directory-lite
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 27, 2014
  • Latest release: Sep 13, 2023
  • Number of updates: 268
  • Update frequency: every 12.9 days
  • Top authors: lddwebdesign (90.67%)delayedinsanity (9.7%)

Code review

54 tests

User reviews

48 reviews

Install metrics

300+ active /38,399 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.47MB] [CPU: ▲6.12ms] Passed 4 tests

An overview of server-side resources used by LDD Directory Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8647.31 ▲9.27
Dashboard /wp-admin5.01 ▲1.6664.57 ▲8.88
Posts /wp-admin/edit.php5.03 ▲1.6863.18 ▲7.63
Add New Post /wp-admin/post-new.php7.61 ▲1.72115.01 ▼1.31
Media Library /wp-admin/upload.php4.92 ▲1.7052.90 ▲20.01
Add-ons /wp-admin/edit.php?post_type=directory_listings&page=lddlite-addons4.8443.61
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=directory_listings5.2352.72
Help /wp-admin/edit.php?post_type=directory_listings&page=lddlite-help4.8447.86
All Listings /wp-admin/edit.php?post_type=directory_listings4.9848.84
Add Listing /wp-admin/post-new.php?post_type=directory_listings5.5164.89
Settings /wp-admin/edit.php?post_type=directory_listings&page=lddlite-settings4.9348.07
Tags /wp-admin/edit-tags.php?taxonomy=listing_tag&post_type=directory_listings4.9246.82

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 566 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
lddlite_version
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
lddlite_settings
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for LDD Directory Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,004 ▲25814.28 ▼0.047.86 ▲6.1039.18 ▲1.77
Dashboard /wp-admin2,279 ▲916.01 ▲1.10106.79 ▲2.3638.72 ▼2.53
Posts /wp-admin/edit.php2,173 ▲842.44 ▲0.4143.63 ▲3.1835.73 ▼1.44
Add New Post /wp-admin/post-new.php1,576 ▲5723.57 ▲0.30627.87 ▼48.5161.11 ▲9.75
Media Library /wp-admin/upload.php1,472 ▲844.38 ▲0.2098.29 ▼1.2841.81 ▼5.04
Add-ons /wp-admin/edit.php?post_type=directory_listings&page=lddlite-addons1,0491.8729.2970.28
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=directory_listings1,5873.3948.1428.93
Help /wp-admin/edit.php?post_type=directory_listings&page=lddlite-help1,0041.8626.8448.49
All Listings /wp-admin/edit.php?post_type=directory_listings1,1672.2737.1027.70
Add Listing /wp-admin/post-new.php?post_type=directory_listings2,9478.16183.0371.91
Settings /wp-admin/edit.php?post_type=directory_listings&page=lddlite-settings1,3612.4236.2548.23
Tags /wp-admin/edit-tags.php?taxonomy=listing_tag&post_type=directory_listings1,3172.3831.0525.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 take a closer look at the following
  • 94× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ldd-directory-lite/includes/cmb/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ldl() in wp-content/plugins/ldd-directory-lite/templates/loop/listingshortcode-grid.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ldl() in wp-content/plugins/ldd-directory-lite/templates/frontend/panel-general.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/ldd-directory-lite/includes/cmb/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ldd-directory-lite/includes/class.tracking.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/ldd-directory-lite/includes/cmb/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/ldd-directory-lite/includes/cmb/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ldd-directory-lite/includes/shortcodes/directory.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ldd-directory-lite/includes/admin/sanitize.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ldd-directory-lite/includes/cmb/includes/types/CMB2_Type_Checkbox.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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:
  • Requires at least: Version not formatted correctly
The official readme.txt might help

ldd-directory-lite/ldd-directory-lite.php Passed 13 tests

The main PHP file in "LDD Directory Lite" ver. 3.2 adds more information about the plugin and also serves as the entry point for this plugin
96 characters long description:
Powerful and simple to use, add a directory of business or other organizations to your web site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin77,299 lines of code in 391 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,65419,30033,036
PHP1234,2638,45415,128
JavaScript272,2051,43510,321
CSS224771,2857,705
Sass891,4641,5666,622
HTML37003,186
Markdown433001,001
SVG100288
YAML14012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity22.00
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes77
▷ Abstract classes911.69%
▷ Concrete classes6888.31%
▷ Final classes00.00%
Methods688
▷ Static methods10014.53%
▷ Public methods58284.59%
▷ Protected methods9113.23%
▷ Private methods152.18%
Functions210
▷ Named functions210100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants1970.37%
▷ Class constants829.63%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
28 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/noimage.png4.80KB2.77KB▼ 42.32%
public/images/logo.png26.26KB4.69KB▼ 82.13%
includes/cmb/images/ico-delete.png0.70KB0.72KB0.00%
includes/cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
public/plugins/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%