84% wp-attach

Code Review | WP Attach

WordPress plugin WP Attach scored84%from 54 tests.

About plugin

  • Plugin page: wp-attach
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Jun 9, 2017
  • Latest release: Jun 12, 2017
  • Number of updates: 11
  • Update frequency: every 0.4 days
  • Top authors: Gabrielchihonglee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /820 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.00ms] Passed 4 tests

A check of server-side resources used by WP Attach
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.30 ▼6.88
Dashboard /wp-admin3.36 ▲0.0645.86 ▲0.10
Posts /wp-admin/edit.php3.47 ▲0.1249.72 ▲3.32
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.53 ▼6.62
Media Library /wp-admin/upload.php3.28 ▲0.0634.77 ▲1.42

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 58 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Attach
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15213.65 ▼0.735.33 ▲3.0346.11 ▲1.46
Dashboard /wp-admin2,207 ▲165.84 ▲1.00137.70 ▲31.4652.55 ▲11.98
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0241.09 ▲4.2534.48 ▲0.30
Add New Post /wp-admin/post-new.php1,518 ▼1623.43 ▲0.34667.45 ▲34.3051.43 ▼3.16
Media Library /wp-admin/upload.php1,392 ▲74.16 ▼0.0592.45 ▼6.7342.73 ▼1.30

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-attach/admin/partials/wpattach-admin-display.php
    • > /wp-content/plugins/wp-attach/public/partials/wpattach-public-display.php

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)
There were no browser issues found

Optimizations

Plugin configuration 93% 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
2 plugin tags: attach, wpattach

wp-attach/wpattach.php 85% from 13 tests

"WP Attach" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-attach.php" instead of "wpattach.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin2,102 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS3248241,809
PHP13147537286
JavaScript24546
YAML1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.29
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.09
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
31 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/fileicon/mp3.png2.82KB1.62KB▼ 42.62%
public/fileicon/xls.png1.82KB1.00KB▼ 45.12%
public/fileicon/docx.png2.01KB1.07KB▼ 46.70%
public/fileicon/png.png2.57KB1.53KB▼ 40.59%
public/fileicon/pptx.png1.78KB1.03KB▼ 42.24%