78% screenly-cast

Code Review | Screenly Cast

WordPress plugin Screenly Cast scored78%from 54 tests.

About plugin

  • Plugin page: screenly-cast
  • Plugin version: 0.1.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7+
  • WordPress version: 6.3.1
  • First release: May 24, 2017
  • Latest release: Sep 7, 2018
  • Number of updates: 22
  • Update frequency: every 22.1 days
  • Top authors: vpetersson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.31ms] Passed 4 tests

Server-side resources used by Screenly Cast
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0641.46 ▲0.42
Dashboard /wp-admin3.36 ▲0.0549.35 ▼4.70
Posts /wp-admin/edit.php3.47 ▲0.1150.60 ▼2.94
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.48 ▼14.01
Media Library /wp-admin/upload.php3.28 ▲0.0537.91 ▲1.93
Screenly /wp-admin/options-general.php?page=screenly3.2545.29

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Screenly Cast: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.17 ▼1.411.82 ▲0.0141.13 ▼11.53
Dashboard /wp-admin2,210 ▲225.88 ▲0.95105.79 ▼6.4539.68 ▲0.13
Posts /wp-admin/edit.php2,072 ▼202.04 ▲0.0437.94 ▼3.4235.66 ▼0.28
Add New Post /wp-admin/post-new.php1,517 ▼217.63 ▼5.67574.90 ▼153.0556.20 ▲5.14
Media Library /wp-admin/upload.php1,389 ▲74.18 ▼0.08148.23 ▲32.5961.84 ▲11.36
Screenly /wp-admin/options-general.php?page=screenly7912.0332.9438.35

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

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

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 9× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/header.php
    • > /wp-content/plugins/screenly-cast/inc/screenly-cast.php
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/404.php
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/functions.php
    • > /wp-content/plugins/screenly-cast/screenly-cast.php
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/attachment.php
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/footer.php
    • > /wp-content/plugins/screenly-cast/tests/bootstrap.php
    • > /wp-content/plugins/screenly-cast/theme/screenly-cast/index.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'SRLY_THEME_DIR/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/screenly-cast/tests/test-theme-functions.php on line 16
    • > PHP Warning
      Use of undefined constant SRLY_THEME_DIR - assumed 'SRLY_THEME_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/screenly-cast/tests/test-theme-functions.php on line 16
    • > PHP Warning
      require_once(SRLY_THEME_DIR/functions.php): failed to open stream: No such file or directory in wp-content/plugins/screenly-cast/tests/test-theme-functions.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/screenly-cast/inc/screenly-cast-settings.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/screenly-cast/tests/test-screenly-cast.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/screenly-cast/tests/test-screenly-cast-admin.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
The official readme.txt is a good inspiration

screenly-cast/screenly-cast.php Passed 13 tests

The main file in "Screenly Cast" v. 0.1.19 serves as a complement to information provided in readme.txt and as the entry point to the plugin
66 characters long description:
WordPress plugin to enable casting of content on Screenly devices.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected945 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP14145654528
CSS14416266
Bourne Shell12111120
JavaScript14631

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.75
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods1352.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1076.92%
▷ Class constants323.08%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
theme/screenly-cast/screenshot.png2.46KB2.65KB0.00%