68% youtube-simplegallery

Code Review | YouTube SimpleGallery

WordPress plugin YouTube SimpleGallery scored68%from 54 tests.

About plugin

  • Plugin page: youtube-simplegal...
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.6
  • WordPress version: 6.3.1
  • First release: Dec 7, 2009
  • Latest release: Jun 22, 2013
  • Number of updates: 72
  • Update frequency: every 18.0 days
  • Top authors: stiand (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /108,077 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.80MB] [CPU: ▼33.55ms] Passed 4 tests

Analyzing server-side resources used by YouTube SimpleGallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.15 ▲0.20
Dashboard /wp-admin3.14 ▼0.1628.37 ▼29.47
Posts /wp-admin/edit.php3.14 ▼0.2127.60 ▼20.34
Add New Post /wp-admin/post-new.php3.14 ▼2.7428.42 ▼69.29
Media Library /wp-admin/upload.php3.14 ▼0.0824.08 ▼15.10
YouTube SimpleGallery /wp-admin/options-general.php?page=youtube-gallery-options3.1428.42

Server storage [IO: ▲0.33MB] [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
theysaidso_admin_options
youtube_gallery_option
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for YouTube SimpleGallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.39 ▲0.232.05 ▼0.0642.98 ▲0.99
Dashboard /wp-admin2,216 ▲395.70 ▲0.0385.09 ▼4.9740.13 ▲0.19
Posts /wp-admin/edit.php2,118 ▲182.06 ▲0.0937.24 ▼1.8839.53 ▲2.70
Add New Post /wp-admin/post-new.php1,543 ▲1723.70 ▲0.73610.57 ▼86.0273.14 ▲6.33
Media Library /wp-admin/upload.php1,415 ▲214.33 ▲0.11100.56 ▲0.0942.82 ▼4.87
YouTube SimpleGallery /wp-admin/options-general.php?page=youtube-gallery-options1,1211.8025.1538.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=youtube-gallery-options
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=youtube-gallery-options
    • > Notice in wp-content/plugins/youtube-simplegallery/inc/options.php+234
    Undefined index: timthumb

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-simplegallery/inc/options.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/youtube-simplegallery/inc/shortcode.php:276
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-simplegallery/inc/admin-widgets.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-simplegallery/inc/notices.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Settings let's you set width and height of embedded video, chose if Thickbox or Shadowbox should be used (note: width and height is only necessary if Thickbox or Shadowbox is active), and use included CSS.), #2 (The gallery will show on your page like this), #3 (If Thickbox or Shadowbox is active, the embedded video will show in a box on your site)
The official readme.txt might help

youtube-simplegallery/youtube_simplegallery.php 85% from 13 tests

The main file in "YouTube SimpleGallery" v. 2.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 169 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("youtube-simplegallery.php" instead of "youtube_simplegallery.php")

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
Success! There were no dangerous files found in this plugin2,230 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP73061872,115
CSS2191107
JavaScript1108

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity205.00
▷ Minimum class complexity205.00
▷ Maximum class complexity205.00
Average method complexity6.83
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods514.29%
▷ Protected methods3085.71%
▷ Private methods00.00%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants46
▷ Global constants46100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.22MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png59.10KB58.01KB▼ 1.86%
screenshot-1.png32.15KB31.51KB▼ 1.99%
screenshot-3.png109.07KB107.73KB▼ 1.23%
img/play.png21.97KB9.23KB▼ 58.00%