94% premium-posts

Code Review | Premium Posts

WordPress plugin Premium Posts scored 94% from 54 tests.

About plugin

  • Plugin page: premium-posts
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5.1
  • WordPress version: 5.8.1
  • First release: May 26, 2013
  • Latest release: May 30, 2013
  • Number of updates: 13
  • Update frequency: every 0.4 days
  • Top authors: sscovil (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 951 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Premium Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1742.16 ▲15.04
Dashboard /wp-admin3.14 ▲0.0953.23 ▲11.83
Posts /wp-admin/edit.php3.25 ▲0.1545.39 ▼0.19
Add New Post /wp-admin/post-new.php5.50 ▲0.07100.08 ▼562.53
Media Library /wp-admin/upload.php3.08 ▲0.0837.51 ▼2.89

Server storage [IO: ▲0.03MB] [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: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Premium Posts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲9715.86 ▲0.429.85 ▲2.0645.37 ▼10.25
Dashboard /wp-admin2,967 ▲305.86 ▼0.10141.68 ▼13.96115.11 ▼6.59
Posts /wp-admin/edit.php2,769 ▲332.70 ▲0.0166.30 ▼1.8394.34 ▲4.78
Add New Post /wp-admin/post-new.php1,500 ▲218.77 ▼0.10381.22 ▲2.12117.86 ▲4.53
Media Library /wp-admin/upload.php1,807 ▼05.01 ▲0.03158.21 ▼3.05130.17 ▼0.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

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 | 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/premium-posts/premium-posts.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 Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: posts, mark, premium, tag, post...

premium-posts/premium-posts.php Passed 13 tests

The entry point to "Premium Posts" version 2.3 is a PHP file that has certain tags in its header comment area
64 characters long description:
Mark posts as "Premium" and display a custom message or ad code.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin362 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP367176296
PO File1152054
JavaScript10012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.50
▷ Minimum class complexity9.00
▷ Maximum class complexity26.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods521.74%
▷ Public methods2191.30%
▷ Protected methods28.70%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin