84% prevent-landscape-rotation

Code Review | Prevent Landscape Rotation

WordPress plugin Prevent Landscape Rotation scored84%from 54 tests.

About plugin

  • Plugin page: prevent-landscape...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 19, 2020
  • Latest release: Mar 28, 2023
  • Number of updates: 25
  • Update frequency: every 44.2 days
  • Top authors: arulprasadj (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /4,538 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: ▼2.51ms] Passed 4 tests

A check of server-side resources used by Prevent Landscape Rotation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.41 ▼7.55
Dashboard /wp-admin3.36 ▲0.0548.23 ▲2.35
Posts /wp-admin/edit.php3.41 ▲0.0555.33 ▲6.40
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.93 ▼9.60
Media Library /wp-admin/upload.php3.28 ▲0.0537.70 ▲4.77
Prevent Landscape Rotation /wp-admin/options-general.php?page=prevent-landscape-rotation/public/admin/adminpage.php3.2634.51

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Prevent Landscape Rotation
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲24113.85 ▼0.5112.78 ▲11.0145.95 ▲3.27
Dashboard /wp-admin2,212 ▲245.91 ▲1.0595.26 ▼12.3840.03 ▼5.63
Posts /wp-admin/edit.php2,092 ▲31.99 ▲0.0138.57 ▼2.2133.78 ▼4.78
Add New Post /wp-admin/post-new.php1,547 ▲418.54 ▲0.26611.38 ▲8.0358.33 ▲12.35
Media Library /wp-admin/upload.php1,394 ▲94.22 ▼0.0197.27 ▼4.4343.09 ▼1.13
Prevent Landscape Rotation /wp-admin/options-general.php?page=prevent-landscape-rotation/public/admin/adminpage.php1,1222.3669.9130.16

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/prevent-landscape-rotation/public/apj-functions.php
    • > /wp-content/plugins/prevent-landscape-rotation/public/admin/adminpage.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: A description for screenshot #3 is required in prevent-landscape-rotation/assets to your readme.txt
The official readme.txt is a good inspiration

prevent-landscape-rotation/prevent-landscape-rotation.php Passed 13 tests

Analyzing the main PHP file in "Prevent Landscape Rotation" version 2.0
44 characters long description:
Prevent Landscape Rotation On Mobile Devices

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected225 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP42989218
JavaScript32117

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods13100.00%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/landscape-pic.png1.84KB1.85KB0.00%