84% tsp-featured-categories

Code Review | LAPDI Featured Categories

WordPress plugin LAPDI Featured Categories scored84%from 54 tests.

About plugin

  • Plugin page: tsp-featured-cate...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Jul 11, 2013
  • Latest release: Feb 8, 2021
  • Number of updates: 73
  • Update frequency: every 38.0 days
  • Top authors: sharrondenice (98.63%)thesoftwarepeople (2.74%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /8,491 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.06ms] Passed 4 tests

Server-side resources used by LAPDI Featured Categories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.11 ▼1.99
Dashboard /wp-admin3.31 ▼0.0349.46 ▼19.14
Posts /wp-admin/edit.php3.36 ▲0.0049.84 ▼0.17
Add New Post /wp-admin/post-new.php5.89 ▲0.0099.99 ▲3.57
Media Library /wp-admin/upload.php3.23 ▲0.0036.32 ▲1.06

Server storage [IO: ▲0.34MB] [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: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for LAPDI Featured Categories
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.161.78 ▲0.2245.26 ▲6.88
Dashboard /wp-admin2,198 ▲185.66 ▲0.1092.41 ▼8.3845.22 ▼0.32
Posts /wp-admin/edit.php2,097 ▼02.00 ▼0.0339.25 ▲4.2238.80 ▲2.86
Add New Post /wp-admin/post-new.php1,531 ▼323.29 ▲0.04672.21 ▲1.3368.38 ▲7.34
Media Library /wp-admin/upload.php1,403 ▲64.22 ▲0.0296.44 ▼1.2446.18 ▼0.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/tsp-featured-categories/tsp-featured-categories.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tsp-featured-categories/tsp-featured-categories.php on line 14
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/tsp-featured-categories/tsp-featured-categories.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/tsp-featured-categories/TSP_Easy_Dev.config.php:16
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tsp-featured-categories/TSP_Easy_Dev.config.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'TSP_Easy_Dev_Options' not found in wp-content/plugins/tsp-featured-categories/TSP_Easy_Dev.extend.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: display gallery, category images, moving boxes, category, slider...

tsp-featured-categories/tsp-featured-categories.php 85% from 13 tests

The main PHP script in "LAPDI Featured Categories" version 1.3.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 211 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected639 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP3104128461
CSS1102688
Smarty30049
Markdown112030
JavaScript421711

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity19.00
▷ Minimum class complexity4.00
▷ Maximum class complexity34.00
Average method complexity6.14
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
7 PNG files occupy 0.25MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/tsp_icon_16.png2.31KB1.03KB▼ 55.38%
assets/images/cursors/cursor_arrow_right.png48.05KB0.12KB▼ 99.75%
assets/images/tsp_icon_25.png3.09KB1.57KB▼ 49.19%
assets/images/tsp_icon.png58.61KB2.59KB▼ 95.58%
assets/images/cursors/cursor_arrow_left.png47.08KB0.12KB▼ 99.75%