84% selectable-post-and-page

Code Review | Selectable Post and Page

WordPress plugin Selectable Post and Page scored 84% from 54 tests.

About plugin

  • Plugin page: selectable-post-a...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.2
  • WordPress version: 5.8.1
  • First release: Dec 29, 2016
  • Latest release: Feb 21, 2017
  • Number of updates: 21
  • Update frequency: every 2.5 days
  • Top authors: happymox (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼141.44ms] Passed 4 tests

Server-side resources used by Selectable Post and Page
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2234.27 ▲8.70
Dashboard /wp-admin3.16 ▲0.1147.44 ▲1.78
Posts /wp-admin/edit.php3.21 ▲0.1146.41 ▼0.83
Add New Post /wp-admin/post-new.php5.52 ▲0.09100.23 ▼571.76
Media Library /wp-admin/upload.php3.10 ▲0.1038.54 ▲5.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 1 new option
New WordPress options
widget_selectable_post_and_page

Browser metrics Passed 4 tests

An overview of browser requirements for Selectable Post and Page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.93 ▲0.028.47 ▼0.1452.96 ▲0.19
Dashboard /wp-admin2,972 ▲415.89 ▼0.08139.49 ▼13.94116.25 ▼4.32
Posts /wp-admin/edit.php2,744 ▲52.70 ▲0.0274.85 ▼0.13104.45 ▲10.76
Add New Post /wp-admin/post-new.php1,687 ▲415.33 ▼3.41383.60 ▼0.18115.36 ▼5.45
Media Library /wp-admin/upload.php1,812 ▲55.02 ▲0.01168.33 ▼3.72123.38 ▼1.02

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
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_selectable_post_and_page

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: pim in wp-content/plugins/selectable-post-and-page/template/full-image.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_size() on null in wp-content/plugins/selectable-post-and-page/template/default.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/selectable-post-and-page/template/list-view.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_size() on null in wp-content/plugins/selectable-post-and-page/template/full-image.php:5
    • > PHP Notice
      Undefined variable: pim in wp-content/plugins/selectable-post-and-page/template/default.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

selectable-post-and-page/selectable-post-and-page.php Passed 13 tests

The entry point to "Selectable Post and Page" version 1.3.4 is a PHP file that has certain tags in its header comment area
76 characters long description:
Add a widget that can display posts from random, a single category and page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin717 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8111163499
CSS22411114
JavaScript1159104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.75
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
17 PNG files occupy 1.59MB with 0.74MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/layout-list.png0.36KB0.15KB▼ 59.18%
screenshots/screenshot-4.png44.42KB24.87KB▼ 44.02%
screenshot-1.png21.18KB13.38KB▼ 36.81%
assets/image/layout-default.png0.34KB0.16KB▼ 54.70%
screenshots/screenshot-1.png21.18KB13.38KB▼ 36.81%