79% press-tube

Code Review | Press Tube

WordPress plugin Press Tube scored79%from 54 tests.

About plugin

  • Plugin page: press-tube
  • Plugin version: 0.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6+
  • WordPress version: 6.3.1
  • First release: Mar 13, 2017
  • Latest release: Apr 3, 2017
  • Number of updates: 15
  • Update frequency: every 1.3 days
  • Top authors: codekraft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,374 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.18MB] [CPU: ▼14.32ms] Passed 4 tests

A check of server-side resources used by Press Tube
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.80 ▼2.71
Dashboard /wp-admin3.16 ▼0.1430.03 ▼20.64
Posts /wp-admin/edit.php3.24 ▼0.1235.96 ▼11.68
Add New Post /wp-admin/post-new.php5.48 ▼0.4178.13 ▼20.25
Media Library /wp-admin/upload.php3.18 ▼0.0530.45 ▼4.71
Press Tube /wp-admin/options-general.php?page=press-tube3.1530.00

Server storage [IO: ▲0.32MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Press Tube
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲16514.29 ▼0.1213.69 ▲11.9540.99 ▼3.12
Dashboard /wp-admin2,215 ▲385.78 ▲0.0995.30 ▲3.6138.68 ▼1.91
Posts /wp-admin/edit.php2,126 ▲262.30 ▲0.3242.45 ▲5.9135.67 ▲2.42
Add New Post /wp-admin/post-new.php1,544 ▲1823.70 ▲0.47685.85 ▲71.7036.18 ▼11.63
Media Library /wp-admin/upload.php1,419 ▲224.51 ▲0.31103.87 ▲2.5043.05 ▲1.36
Press Tube /wp-admin/options-general.php?page=press-tube1,4909.29324.0076.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=press-tube
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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 take a closer look at the following
  • 21× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/press-tube/press-tube.php
    • > /wp-content/plugins/press-tube/include/class-main.php
    • > /wp-content/plugins/press-tube/views/settings-page.php
    • > /wp-content/plugins/press-tube/include/class-yt-client.php
    • > /wp-content/plugins/press-tube/include/shortcodes/playlist.php
    • > /wp-content/plugins/press-tube/include/settings/class-option-channel-details.php
    • > /wp-content/plugins/press-tube/include/class-utils.php
    • > /wp-content/plugins/press-tube/include/settings/class-option-main.php
    • > /wp-content/plugins/press-tube/include/shortcodes/subscribe.php
    • > /wp-content/plugins/press-tube/views/settings-dashboard.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: video, share, playlist, youtube, embed...

press-tube/press-tube.php Passed 13 tests

The principal PHP file in "Press Tube" v. 0.0.3 is loaded by WordPress automatically on each request
85 characters long description:
The easiest way to integrate YouTube in your WordPress site, with many functionality.

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 detected2,437 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP217647511,591
JavaScript8248282624
PO File17982205
SVG30014
CSS3033

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.24
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods111
▷ Static methods2320.72%
▷ Public methods9585.59%
▷ Protected methods65.41%
▷ Private methods109.01%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/dist/img/banner.png17.92KB9.63KB▼ 46.24%