78% wp-media-assistant

Code Review | WP Media Assistant

WordPress plugin WP Media Assistant scored78%from 54 tests.

About plugin

  • Plugin page: wp-media-assistant
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2019
  • Latest release: Jun 7, 2020
  • Number of updates: 15
  • Update frequency: every 23.8 days
  • Top authors: justinahinon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,139 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.18ms] Passed 4 tests

A check of server-side resources used by WP Media Assistant
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.20 ▼7.98
Dashboard /wp-admin3.39 ▲0.0954.95 ▲6.18
Posts /wp-admin/edit.php3.50 ▲0.1551.58 ▲0.93
Add New Post /wp-admin/post-new.php5.97 ▲0.0996.48 ▲0.41
Media Library /wp-admin/upload.php3.31 ▲0.0937.11 ▲1.93
WP Media Assistant /wp-admin/upload.php?page=wpma_dashboard3.2738.72

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Media Assistant
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.29 ▼1.011.62 ▼0.3742.00 ▼1.08
Dashboard /wp-admin2,213 ▲224.84 ▼1.0795.93 ▼5.8342.49 ▲0.45
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0241.59 ▼0.6235.03 ▼2.98
Add New Post /wp-admin/post-new.php1,517 ▼1617.44 ▼5.85728.64 ▲49.2052.31 ▼4.55
Media Library /wp-admin/upload.php1,395 ▲104.22 ▲0.01106.84 ▼3.8446.56 ▲1.63
WP Media Assistant /wp-admin/upload.php?page=wpma_dashboard9314.38138.1239.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=wpma_dashboard
    • > Notice in wp-content/plugins/wp-media-assistant/inc/main-functions.php+70
    Undefined variable: wpma_medias_url_list
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=wpma_dashboard
    • > Warning in wp-content/plugins/wp-media-assistant/inc/main-functions.php+278
    sizeof(): Parameter must be an array or an object that implements Countable
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=wpma_dashboard
    • > Warning in wp-content/plugins/wp-media-assistant/inc/main-functions.php+274
    Invalid argument supplied for foreach()
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=wpma_dashboard
    • > Notice in wp-content/plugins/wp-media-assistant/inc/main-functions.php+90
    Undefined variable: wpma_medias_size_list
    • > GET request to /wp-admin/upload.php?page=wpma_dashboard
    • > Warning in wp-content/plugins/wp-media-assistant/inc/options-page.php+50
    array_sum() expects parameter 1 to be array, null given

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions 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/wp-media-assistant/inc/main-functions.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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #2 (WPMA options page), #3 (WPMA options page)
The official readme.txt is a good inspiration

wp-media-assistant/wp-media-assistant.php Passed 13 tests

The main PHP file in "WP Media Assistant" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
58 characters long description:
Display useful informations about WordPress media library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin568 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP5113100488
CSS18037
Markdown211034
JavaScript30409

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.40
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes240.00%
▷ Concrete classes360.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.18MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png26.76KB14.04KB▼ 47.53%
assets/icon-256x256.png5.88KB3.83KB▼ 34.88%
assets/screenshot-3.png44.23KB29.05KB▼ 34.32%
assets/banner-772x250.png22.60KB9.06KB▼ 59.90%
assets/banner-1544x500.png46.38KB19.21KB▼ 58.58%