90% wp-truncate-content

Code Review | WP Truncate Content

WordPress plugin WP Truncate Content scored90%from 54 tests.

About plugin

  • Plugin page: wp-truncate-content
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 14, 2014
  • Latest release: Jun 14, 2014
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: eyouth.ace (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,078 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by WP Truncate Content
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.28 ▲3.00
Dashboard /wp-admin3.31 ▲0.0147.32 ▼4.86
Posts /wp-admin/edit.php3.36 ▲0.0147.94 ▼3.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.58 ▲3.46
Media Library /wp-admin/upload.php3.23 ▲0.0037.40 ▼0.10

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Truncate Content
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.84 ▼0.758.25 ▲6.5042.74 ▼2.27
Dashboard /wp-admin2,197 ▲205.62 ▲0.0498.06 ▲0.5141.57 ▲1.84
Posts /wp-admin/edit.php2,099 ▼12.03 ▲0.0240.25 ▲2.7334.34 ▼1.26
Add New Post /wp-admin/post-new.php1,528 ▲223.61 ▲0.65686.16 ▲17.5146.83 ▼0.88
Media Library /wp-admin/upload.php1,405 ▲54.17 ▼0.08101.93 ▼3.5544.71 ▼2.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: partially display content, content hidden, visible content, hide content, truncate content

wp-truncate-content/wp-truncate-content.php 92% from 13 tests

The main file in "WP Truncate Content" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 467 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin217 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP34487121
JavaScript2111782
CSS11014

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1285.71%
▷ Protected methods00.00%
▷ Private methods214.29%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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/js/images/crea8.png1.63KB0.64KB▼ 60.66%