84% adapter-post-preview

Code Review | Adapter Post Preview

WordPress plugin Adapter Post Preview scored 84% from 54 tests.

About plugin

  • Plugin page: adapter-post-preview
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 5.8.1
  • First release: Sep 24, 2014
  • Latest release: Jul 11, 2018
  • Number of updates: 10
  • Update frequency: every 138.7 days
  • Top authors: ryankienstra (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active / 1,875 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼143.22ms] Passed 4 tests

A check of server-side resources used by Adapter Post Preview
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.0634.58 ▼0.17
Dashboard /wp-admin3.12 ▲0.0644.50 ▲0.94
Posts /wp-admin/edit.php3.20 ▲0.0842.94 ▼12.82
Add New Post /wp-admin/post-new.php5.47 ▲0.0491.19 ▼559.11
Media Library /wp-admin/upload.php3.06 ▲0.0632.50 ▼0.76

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 1 new option
New WordPress options
widget_adapter_post_preview

Browser metrics Passed 4 tests

Adapter Post Preview: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲9215.99 ▲0.429.01 ▼3.6448.93 ▲1.13
Dashboard /wp-admin2,967 ▲335.94 ▼0.03138.90 ▼5.71114.08 ▲0.06
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0062.64 ▼4.1799.31 ▲5.47
Add New Post /wp-admin/post-new.php1,901 ▼1,78819.24 ▲4.12387.69 ▼63.20103.61 ▼4.32
Media Library /wp-admin/upload.php1,810 ▲35.03 ▼0.00140.56 ▼10.90125.16 ▲7.22

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
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_adapter_post_preview

Smoke tests 75% 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)
Even though no errors were found, this is by no means 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 items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/adapter-post-preview/php/class-adapter-post-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AdapterPostPreview\\esc_attr() in wp-content/plugins/adapter-post-preview/php/templates/carousel.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AdapterPostPreview\\plugins_url() in wp-content/plugins/adapter-post-preview/php/class-plugin.php:92

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: post, responsive, bootstrap, widgets, mobile

adapter-post-preview/adapter-post-preview.php 92% from 13 tests

The principal PHP file in "Adapter Post Preview" v. 1.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)

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 detected317 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP557234235
CSS115160
XML15222

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin