58% text-truncator

Code Review | Text Truncator

WordPress plugin Text Truncator scored58%from 54 tests.

About plugin

  • Plugin page: text-truncator
  • Plugin version: 1...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2015
  • Latest release: Jul 5, 2015
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,032 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.58MB] [CPU: ▼6.44ms] Passed 4 tests

A check of server-side resources used by Text Truncator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3141.05 ▼4.39
Dashboard /wp-admin3.99 ▲0.6552.20 ▼10.87
Posts /wp-admin/edit.php4.11 ▲0.7551.71 ▲1.19
Add New Post /wp-admin/post-new.php6.58 ▲0.6989.72 ▼11.68
Media Library /wp-admin/upload.php3.92 ▲0.6940.44 ▲1.59
Trucator /wp-admin/themes.php?page=ttc_settings5.2066.00

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

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

Browser metrics Passed 4 tests

Text Truncator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲15914.08 ▼0.317.81 ▲6.0938.09 ▼5.62
Dashboard /wp-admin2,228 ▲314.88 ▼1.00113.16 ▲7.8040.35 ▲4.47
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0239.86 ▼0.4636.84 ▲0.91
Add New Post /wp-admin/post-new.php1,543 ▲1723.02 ▲5.57657.16 ▼18.2152.39 ▼8.07
Media Library /wp-admin/upload.php1,407 ▲74.25 ▲0.04100.18 ▼13.7345.67 ▼5.48
Trucator /wp-admin/themes.php?page=ttc_settings1,2162.4041.4330.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Error in wp-content/plugins/text-truncator/text-truncator.php+16
    Cannot declare class TextTruncator_Registry_Base, because the name is already in use
  • Uninstaller has failed for this plugin, leaving 211 files (0.85MB) in the plugin directory
    • (new file) include/class/admin/_abstract/TextTruncator_AdminPage_RootBase.php
    • (new file) asset/css/admin.css
    • (new file) asset/js/trunk8-enabler.js
    • (new file) asset/js/trunk8.js
    • (new file) include/class/admin/_abstract/TextTruncator_AdminPage_Page_Base.php
    • (new file) asset/js/LICENSE
    • (new file) include/class/admin/TextTruncator_AdminPage.php
    • (new file) include/class-list.php
    • (new file) include/class/admin/_abstract/TextTruncator_AdminPage_Tab_Base.php
    • (new file) include/class/admin/_abstract/TextTruncator_AdminPage_Section_Base.php
    • ...
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 181× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_FormElement' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework_Factory/model/AdminPageFramework_FormElement/AdminPageFramework_FormElement_Meta.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_Form_Model' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework/AdminPageFramework_Form_View.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_Resource_Base' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework_Widget/controller/AdminPageFramework_Resource_Widget.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_PostType_View' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework_PostType/AdminPageFramework_PostType_Controller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_FieldType' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework_Factory/view/AdminPageFramework_FieldType/AdminPageFramework_FieldType_textarea.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_Page_Model' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework/AdminPageFramework_Page_View_MetaBox.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework' not found in wp-content/plugins/text-truncator/include/class/admin/TextTruncator_AdminPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_Router' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework/AdminPageFramework_Form_Model_Imort.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPage_RootBase' not found in wp-content/plugins/text-truncator/include/class/admin/_abstract/TextTruncator_AdminPage_Page_Base.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'TextTruncator_AdminPageFramework_FormField_Base' not found in wp-content/plugins/text-truncator/include/library/admin-page-framework/factory/AdminPageFramework_Factory/view/AdminPageFramework_FormField/AdminPageFramework_FormField_FieldDefinition.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/themes.php?page=ttc_settings
    • > Network (severe)
    wp-content/plugins/text-truncator/asset/css/ttc_settings.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (**Front-end**), #2 (**Setting Page**)
You can look at the official readme.txt

text-truncator/text-truncator.php 92% from 13 tests

The principal PHP file in "Text Truncator" v. 1... is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "1...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected13,544 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP2028652,38213,185
JavaScript27164316
Markdown123043

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.04
▷ Minimum class complexity1.00
▷ Maximum class complexity157.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes202
▷ Abstract classes8642.57%
▷ Concrete classes11657.43%
▷ Final classes43.45%
Methods1,198
▷ Static methods17214.36%
▷ Public methods63753.17%
▷ Protected methods25321.12%
▷ Private methods30825.71%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants13.85%
▷ Class constants2596.15%
▷ Public constants25100.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
No PNG files were detected