83% tldr-cta

Code Review | TLDR

WordPress plugin TLDR scored83%from 54 tests.

About plugin

  • Plugin page: tldr-cta
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 7, 2016
  • Latest release: Mar 29, 2016
  • Number of updates: 39
  • Update frequency: every 0.6 days
  • Top authors: matthewbarby (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /2,629 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.18MB] [CPU: ▼2.60ms] Passed 4 tests

Analyzing server-side resources used by TLDR
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1647.14 ▲7.80
Dashboard /wp-admin3.53 ▲0.2351.68 ▲2.82
Posts /wp-admin/edit.php3.58 ▲0.2357.58 ▲1.08
Add New Post /wp-admin/post-new.php6.08 ▲0.2088.67 ▼12.48
Media Library /wp-admin/upload.php3.37 ▲0.1436.22 ▼1.81

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TLDR
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,052 ▲30615.18 ▲0.775.96 ▲4.2841.19 ▲0.96
Dashboard /wp-admin2,373 ▲1926.39 ▲0.73108.95 ▲10.3638.16 ▼4.43
Posts /wp-admin/edit.php2,301 ▲2013.56 ▲1.5351.34 ▲9.6730.83 ▼8.07
Add New Post /wp-admin/post-new.php1,773 ▲24521.12 ▼1.92667.09 ▼23.8848.10 ▼5.31
Media Library /wp-admin/upload.php1,438 ▲384.30 ▲0.1495.99 ▼5.3445.83 ▲2.32

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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

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
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tldr-cta/admin/partials/templates/post-summary-cta.tpl.php:7
    • > PHP Notice
      Undefined variable: cta_summary in wp-content/plugins/tldr-cta/admin/partials/templates/post-summary-cta.tpl.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/tldr-cta/admin/partials/templates/admin-settings.tpl.php:3
    • > PHP Notice
      Undefined variable: do_not_display_summary in wp-content/plugins/tldr-cta/admin/partials/templates/post-summary.tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tldr-cta/admin/partials/templates/post-summary.tpl.php:6

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (TLDR plugin in action on my blog.), #2 (Summary meta box that can be found below each of your blog posts within WordPress admin.), #3 (CTA meta box that can be found below each of your blog posts within WordPress admin.), #4 (TLDR being activated within a blog post to show a summary and relevant CTA.), #5 (Some of the customisation options within the plugin settings page.)
Please take inspiration from this readme.txt

tldr-cta/post-summary.php 85% from 13 tests

The primary PHP file in "TLDR" version 1.1.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tldr-cta.php" instead of "post-summary.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin3,038 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JSON1001,602
PHP152916401,027
JavaScript34166219
CSS25010190

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.22
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods44
▷ Static methods24.55%
▷ Public methods3988.64%
▷ Protected methods00.00%
▷ Private methods511.36%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.93MB with 0.64MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png334.61KB117.70KB▼ 64.83%
assets/banner-772x250.png29.66KB5.69KB▼ 80.83%
screenshot-3.png128.52KB38.75KB▼ 69.85%
screenshot-4.png172.33KB68.66KB▼ 60.16%
screenshot-5.png204.98KB60.94KB▼ 70.27%