84% tsp-on-this-day

Code Review | LAPDI On This Day

WordPress plugin LAPDI On This Day scored84%from 54 tests.

About plugin

  • Plugin page: tsp-on-this-day
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.6.1
  • WordPress version: 6.3.1
  • First release: Jul 28, 2015
  • Latest release: Feb 9, 2021
  • Number of updates: 23
  • Update frequency: every 88.0 days
  • Top authors: sharrondenice (86.96%)thesoftwarepeople (17.39%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,441 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▲5.53ms] Passed 4 tests

An overview of server-side resources used by LAPDI On This Day
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0045.90 ▲4.92
Dashboard /wp-admin3.31 ▲0.0167.07 ▲15.29
Posts /wp-admin/edit.php3.36 ▲0.0053.71 ▲3.33
Add New Post /wp-admin/post-new.php5.89 ▲0.00103.18 ▲6.01
Media Library /wp-admin/upload.php3.23 ▲0.0043.92 ▲7.85

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

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

Browser metrics Passed 4 tests

Checking browser requirements for LAPDI On This Day
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.59 ▼0.062.26 ▲0.3761.18 ▲17.97
Dashboard /wp-admin2,206 ▲184.82 ▼0.26123.56 ▲7.9646.80 ▲1.15
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0648.34 ▲12.3049.89 ▲14.84
Add New Post /wp-admin/post-new.php1,533 ▲520.82 ▲2.37750.36 ▲90.6255.12 ▲5.44
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.10109.49 ▼2.5147.43 ▲1.88

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/tsp-on-this-day/tsp-on-this-day.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'TSP_Easy_Dev_Options' not found in wp-content/plugins/tsp-on-this-day/TSP_Easy_Dev.extend.php:12
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/tsp-on-this-day/tsp-on-this-day.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-on-this-day/tsp-on-this-day.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-on-this-day/TSP_Easy_Dev.config.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/tsp-on-this-day/TSP_Easy_Dev.config.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: on this day display gallery slider jquery moving boxes the software people

tsp-on-this-day/tsp-on-this-day.php 85% from 13 tests

"LAPDI On This Day" version 1.0.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 215 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 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,719 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript577145545
PHP3114116520
CSS49387407
Smarty600215
Markdown113032

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity22.00
▷ Minimum class complexity4.00
▷ Maximum class complexity40.00
Average method complexity9.40
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.19MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/leftshadow.png0.15KB0.14KB▼ 3.92%
assets/images/arrows.png78.22KB1.64KB▼ 97.90%
assets/images/tsp_icon.png58.61KB2.59KB▼ 95.58%
assets/images/twitter_custom.png1.61KB1.53KB▼ 4.62%
assets/images/tsp_icon_25.png3.09KB1.57KB▼ 49.19%