84% get-filesize-shortcode

Code Review | Get Filesize Shortcode

WordPress plugin Get Filesize Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: get-filesize-shor...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 6.3.1
  • First release: Jan 21, 2015
  • Latest release: Jun 5, 2020
  • Number of updates: 35
  • Update frequency: every 56.1 days
  • Top authors: ikaring (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /2,847 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.57ms] Passed 4 tests

Server-side resources used by Get Filesize Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.95 ▼5.14
Dashboard /wp-admin3.31 ▲0.0051.35 ▲1.18
Posts /wp-admin/edit.php3.36 ▲0.0045.65 ▲4.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.97 ▲9.40
Media Library /wp-admin/upload.php3.23 ▲0.0032.72 ▼2.44

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Get Filesize Shortcode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.28 ▼1.311.70 ▼0.2446.66 ▼0.08
Dashboard /wp-admin2,206 ▲154.84 ▼0.03100.57 ▼13.3439.13 ▼4.90
Posts /wp-admin/edit.php2,086 ▼32.06 ▼0.0534.96 ▼20.8135.83 ▲0.61
Add New Post /wp-admin/post-new.php1,543 ▲1018.24 ▼4.87613.89 ▼68.7559.84 ▲2.41
Media Library /wp-admin/upload.php1,388 ▼34.32 ▲0.1094.74 ▼6.6343.45 ▼3.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/get-filesize-shortcode/get-filesize-shortcode.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: filesize, shortcode, pdf

get-filesize-shortcode/get-filesize-shortcode.php 92% from 13 tests

The principal PHP file in "Get Filesize Shortcode" v. 1.1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)

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
Good job! No executable or dangerous file extensions detected45 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112523
PO File151022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
There were not PNG files found in your plugin