83% tinypng-for-wp

Code Review | TinyPNG for Wordpress

WordPress plugin TinyPNG for Wordpress scored 83% from 54 tests.

About plugin

  • Plugin page: tinypng-for-wp
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2013
  • Latest release: Nov 9, 2015
  • Number of updates: 17
  • Update frequency: every 41.5 days
  • Top authors: kakashihatake2 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active / 10,142 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
Install script ran successfully

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

An overview of server-side resources used by TinyPNG for Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.01 ▼5.28
Dashboard /wp-admin3.31 ▲0.0145.31 ▼3.40
Posts /wp-admin/edit.php3.36 ▲0.0147.27 ▼1.69
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.63 ▼16.62
Media Library /wp-admin/upload.php3.23 ▲0.0137.52 ▲5.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by TinyPNG for Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8213.30 ▼1.381.58 ▼0.1639.56 ▼10.54
Dashboard /wp-admin2,223 ▲325.83 ▲0.9597.46 ▼5.0468.15 ▲28.41
Posts /wp-admin/edit.php2,109 ▲172.00 ▼0.0239.10 ▼1.4833.19 ▼2.82
Add New Post /wp-admin/post-new.php1,692 ▲15524.90 ▲1.77711.95 ▲122.0753.84 ▲7.72
Media Library /wp-admin/upload.php1,396 ▲84.23 ▼0.0497.90 ▼1.8065.91 ▲20.96

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tinypng-for-wp/options.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === tinypng-for-wp === )
Please take inspiration from this readme.txt

tinypng-for-wp/options.php 92% from 13 tests

The main PHP file in "TinyPNG for Wordpress" ver. 0.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("tinypng-for-wp.php" instead of "options.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected248 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22211227
CSS15021

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tinypng.png9.76KB3.51KB▼ 64.02%
(invalid) tinypngicon.png1.12KB0.00KB▼ 100.00%