84% post-attachment-sizes

Code Review | Post Attachment Sizes

WordPress plugin Post Attachment Sizes scored84%from 54 tests.

About plugin

  • Plugin page: post-attachment-s...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.7
  • WordPress version: 6.3.1
  • First release: Apr 10, 2017
  • Latest release: Apr 10, 2017
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: TyB (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /546 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▲2.27ms] Passed 4 tests

This is a short check of server-side resources used by Post Attachment Sizes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0554.02 ▲12.50
Dashboard /wp-admin3.36 ▲0.0659.28 ▲6.22
Posts /wp-admin/edit.php3.48 ▲0.1259.11 ▲4.39
Add New Post /wp-admin/post-new.php5.94 ▲0.05103.98 ▼4.65
Media Library /wp-admin/upload.php3.28 ▲0.0440.93 ▲3.12

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Post Attachment Sizes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.68 ▲0.331.94 ▲0.0345.14 ▼0.79
Dashboard /wp-admin2,198 ▲215.65 ▼0.0490.49 ▼11.2443.81 ▲0.31
Posts /wp-admin/edit.php2,130 ▲301.97 ▲0.0437.46 ▼1.2735.58 ▲5.14
Add New Post /wp-admin/post-new.php1,526 ▼222.96 ▲2.21676.06 ▼15.2361.68 ▼1.47
Media Library /wp-admin/upload.php1,400 ▲34.24 ▲0.0998.04 ▼25.7541.96 ▼5.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
Please fix the following
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/post-attachment-sizes/inc/class-pas-attachments.php
    • > /wp-content/plugins/post-attachment-sizes/inc/admin/class-pas-admin.php
    • > /wp-content/plugins/post-attachment-sizes/post-attachment-sizes.php
    • > /wp-content/plugins/post-attachment-sizes/inc/class-pas-activator.php
    • > /wp-content/plugins/post-attachment-sizes/inc/class-pas-deactivator.php
    • > /wp-content/plugins/post-attachment-sizes/inc/class-pas.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: attachments, post attachments, file size, post size, images...

post-attachment-sizes/post-attachment-sizes.php 92% from 13 tests

The main file in "Post Attachment Sizes" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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 detected230 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP895260216
JSON10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.80
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods1260.00%
▷ Protected methods210.00%
▷ Private methods630.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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 were not PNG files found in your plugin