83% presto-delivery

Code Review | Presto Media

WordPress plugin Presto Media scored83%from 54 tests.

About plugin

  • Plugin page: presto-delivery
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Sep 5, 2017
  • Latest release: Nov 10, 2019
  • Number of updates: 20
  • Update frequency: every 41.4 days
  • Top authors: prestomedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,692 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.58MB] [CPU: ▼21.89ms] Passed 4 tests

Analyzing server-side resources used by Presto Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.33 ▲1.62
Dashboard /wp-admin3.42 ▲0.0745.08 ▼17.64
Posts /wp-admin/edit.php3.53 ▲0.1749.87 ▼1.25
Add New Post /wp-admin/post-new.php3.29 ▼2.6038.71 ▼68.05
Media Library /wp-admin/upload.php3.34 ▲0.1135.12 ▼0.60
Presto Media /wp-admin/options-general.php?page=prestomedia3.2931.60

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
prestomedia-auth-secret
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Presto Media
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.72 ▼0.651.80 ▼0.1643.18 ▼9.21
Dashboard /wp-admin2,217 ▲294.91 ▼0.99108.01 ▲4.1641.97 ▼2.68
Posts /wp-admin/edit.php2,100 ▲82.20 ▲0.2340.09 ▼3.5634.60 ▼0.74
Add New Post /wp-admin/post-new.php1,521 ▼1317.42 ▼5.85616.90 ▼66.2157.27 ▲8.35
Media Library /wp-admin/upload.php1,396 ▲84.28 ▲0.09101.56 ▼1.0843.56 ▼0.17
Presto Media /wp-admin/options-general.php?page=prestomedia8191.7925.8327.67

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • prestomedia-auth-secret
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/presto-delivery/class-presto-media-post-publish.php:127
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/presto-delivery/class-presto-media-post-publish.php:127
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/presto-delivery/admin-page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: publishing, delivery, content, presto media

presto-delivery/presto-media-api.php 77% from 13 tests

The primary PHP file in "Presto Media" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("presto-delivery.php" instead of "presto-media-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin718 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP6138363644
JavaScript27649
JSON30025

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity17.75
▷ Minimum class complexity5.00
▷ Maximum class complexity52.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1132.35%
▷ Public methods3294.12%
▷ Protected methods00.00%
▷ Private methods25.88%
Functions10
▷ Named functions220.00%
▷ Anonymous functions880.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.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
4 PNG files occupy 0.35MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/assetsbanner-772x250-rtl.png91.58KB38.79KB▼ 57.65%
assets/icon-256x256.png11.17KB4.51KB▼ 59.62%
assets/assetsbanner-1544x500-rtl.png247.85KB111.22KB▼ 55.13%
assets/icon-128x128.png5.61KB2.59KB▼ 53.79%