84% pm-truncated-recent-posts

Code Review | Truncate Recent Posts Titles

WordPress plugin Truncate Recent Posts Titles scored84%from 54 tests.

About plugin

  • Plugin page: pm-truncated-rece...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.7
  • WordPress version: 6.3.1
  • First release: Nov 27, 2015
  • Latest release: Nov 30, 2016
  • Number of updates: 11
  • Update frequency: every 33.6 days
  • Top authors: pmclain (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /1,175 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Truncate Recent Posts Titles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.56 ▼4.62
Dashboard /wp-admin3.32 ▲0.0146.51 ▼4.72
Posts /wp-admin/edit.php3.37 ▲0.0151.49 ▲0.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.26 ▼3.04
Media Library /wp-admin/upload.php3.24 ▲0.0139.78 ▼0.00

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Truncate Recent Posts Titles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2913.29 ▼1.091.90 ▼0.1740.40 ▼6.76
Dashboard /wp-admin2,221 ▲184.89 ▼1.0199.55 ▼14.2839.47 ▼8.11
Posts /wp-admin/edit.php2,100 ▲32.04 ▼0.0040.35 ▲2.5234.54 ▲1.06
Add New Post /wp-admin/post-new.php1,526 ▼1917.63 ▼5.60705.17 ▲38.0653.58 ▲4.12
Media Library /wp-admin/upload.php1,403 ▲34.31 ▲0.04104.06 ▲0.0145.75 ▲0.51

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_pm_recent_posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • 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
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pm-truncated-recent-posts/pm-recent-posts.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: recent posts widget, truncate

pm-truncated-recent-posts/pm-recent-posts.php 92% from 13 tests

"Truncate Recent Posts Titles" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pm-truncated-recent-posts.php" instead of "pm-recent-posts.php")

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
Success! There were no dangerous files found in this plugin95 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1185195

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin