83% paste-to-media

Code Review | Paste To Media

WordPress plugin Paste To Media scored83%from 54 tests.

About plugin

  • Plugin page: paste-to-media
  • Plugin version: 0.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Sep 3, 2019
  • Latest release: Oct 28, 2019
  • Number of updates: 13
  • Update frequency: every 5.2 days
  • Top authors: davisvilums (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /2,321 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
Installer ran successfully

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

Server-side resources used by Paste To Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.79 ▼3.23
Dashboard /wp-admin3.33 ▼0.0251.18 ▼13.83
Posts /wp-admin/edit.php3.38 ▲0.0248.59 ▼6.47
Add New Post /wp-admin/post-new.php5.93 ▲0.0498.67 ▼3.71
Media Library /wp-admin/upload.php3.25 ▲0.0236.08 ▼1.07

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paste To Media
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.41 ▲0.041.79 ▼0.0645.85 ▲2.47
Dashboard /wp-admin2,200 ▲235.63 ▲0.0686.44 ▼17.6641.55 ▼1.93
Posts /wp-admin/edit.php2,105 ▲52.02 ▲0.0135.38 ▼1.2434.31 ▼0.74
Add New Post /wp-admin/post-new.php1,531 ▼023.80 ▲1.13673.06 ▼14.0353.82 ▼2.75
Media Library /wp-admin/upload.php1,402 ▲54.33 ▲0.19101.42 ▼4.6444.14 ▼0.69

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

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)
Even though everything seems fine, this is not 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 take a closer look at the following
  • 1× 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/paste-to-media/paste-to-media.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
  • Plugin Name: Please specify the plugin name on the first line ( === paste-to-media === )
You can take inspiration from this readme.txt

paste-to-media/paste-to-media.php 92% from 13 tests

The main file in "Paste To Media" v. 0.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected141 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1382388
JavaScript11053

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods375.00%
▷ Protected methods00.00%
▷ Private methods125.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected