74% tsu

Code Review | Tsu

WordPress plugin Tsu scored 74% from 54 tests.

About plugin

  • Plugin page: tsu
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Nov 9, 2014
  • Latest release: Dec 29, 2014
  • Number of updates: 17
  • Update frequency: every 3.0 days
  • Top authors: noplanman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,022 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.67MB] [CPU: ▼49.28ms] Passed 4 tests

A check of server-side resources used by Tsu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.149.65 ▼36.86
Dashboard /wp-admin2.34 ▼0.9712.72 ▼41.14
Posts /wp-admin/edit.php2.34 ▼1.0213.83 ▼33.61
Add New Post /wp-admin/post-new.php2.34 ▼3.5512.67 ▼85.52
Media Library /wp-admin/upload.php2.34 ▼0.8911.72 ▼25.82

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_tsu
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Tsu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4613.17 ▼1.231.90 ▼0.5140.56 ▼10.51
Dashboard /wp-admin2,203 ▲155.79 ▲0.8595.51 ▼16.9940.16 ▼8.56
Posts /wp-admin/edit.php2,092 ▲32.18 ▲0.1539.30 ▲3.7833.49 ▼0.04
Add New Post /wp-admin/post-new.php1,533 ▼023.46 ▲0.20687.66 ▲25.6548.52 ▼3.98
Media Library /wp-admin/upload.php1,388 ▲64.21 ▲0.0294.81 ▼3.0742.12 ▼4.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Tsu_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_tsu
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/tsu/tsu.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tsu/inc/class-tsu-widget.php:10

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: widget, invite, social, share, network...

tsu/tsu.php Passed 13 tests

This is the main PHP file of "Tsu" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
64 characters long description:
Tsu widget to share your profile / invitation with your readers.

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
No dangerous file extensions were detected354 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP469261205
PO File34860149

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.00
▷ Minimum class complexity3.00
▷ Maximum class complexity14.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods20
▷ Static methods1365.00%
▷ Public methods1575.00%
▷ Protected methods00.00%
▷ Private methods525.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.10MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/tsu-logo-96x96.png19.43KB3.68KB▼ 81.07%
images/tsu-logo-16x16.png15.21KB0.90KB▼ 94.06%
images/tsu-logo-32x32.png16.03KB1.56KB▼ 90.26%
images/tsu-logo-64x64.png17.70KB2.60KB▼ 85.30%
images/tsu-logo-128x128.png21.46KB4.94KB▼ 76.98%