10% postsaver

Code Review | PostSaver

WordPress plugin PostSaver scored10%from 54 tests.

About plugin

  • Plugin page: postsaver
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Oct 20, 2021
  • Latest release: Oct 20, 2021
  • Number of updates: 20
  • Update frequency: N/A
  • Top authors: jakerossevans (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /244 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/postsaver/postsaver.php+39
    Constant POSTSAVER_VERSION_NUM already defined

Server metrics [RAM: ▼1.82MB] [CPU: ▼56.63ms] Passed 4 tests

A check of server-side resources used by PostSaver
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.54 ▼36.89
Dashboard /wp-admin2.18 ▼1.127.11 ▼49.62
Posts /wp-admin/edit.php2.19 ▼1.177.48 ▼41.81
Add New Post /wp-admin/post-new.php2.18 ▼3.706.61 ▼98.18
Media Library /wp-admin/upload.php2.19 ▼1.047.51 ▼33.21
Settings /wp-admin/admin.php?page=PostSaver-Options-settings2.197.89

Server storage [IO: ▲1.87MB] [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: 28 new files
Database: 2 new tables, 6 new options
New tables
wp_postsaver_settings
wp_postsaver_users
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PostSaver
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16613.67 ▼0.737.80 ▲5.6342.09 ▼4.53
Dashboard /wp-admin2,207 ▲275.84 ▲0.1791.49 ▼0.9586.53 ▲44.30
Posts /wp-admin/edit.php2,130 ▲302.28 ▲0.2936.19 ▲0.1533.75 ▼2.55
Add New Post /wp-admin/post-new.php1,562 ▲3618.23 ▼4.78719.73 ▲9.3855.36 ▲1.40
Media Library /wp-admin/upload.php1,418 ▲214.36 ▲0.12107.92 ▼10.9579.44 ▲30.39
Settings /wp-admin/admin.php?page=PostSaver-Options-settings1,1262.1337.7436.60

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/postsaver/postsaver.php+39
    Constant POSTSAVER_VERSION_NUM already defined
  • Zombie tables were found after uninstall: 2 tables
    • wp_postsaver_settings
    • wp_postsaver_users
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=PostSaver-Options-settings
    • > Notice in wp-content/plugins/postsaver/postsaver.php+39
    Constant POSTSAVER_VERSION_NUM already defined
    • > GET request to /wp-admin/admin.php?page=PostSaver-Options-settings
    • > Notice in wp-content/plugins/postsaver/includes/ui/class-admin-settings-settings1-tab-ui.php+119
    Undefined variable: iconurl

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/postsaver/includes/classes/class-postsaver-dashboard-ui.php

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
No tags were found

postsaver/postsaver.php Passed 13 tests

The main PHP script in "PostSaver" version 1.0.0 is automatically included on every request by WordPress
87 characters long description:
A Plugin allowing visitors to create an account and save blog posts for future viewing!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,584 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP93723571,121
JavaScript211764291
SVG503170
CSS2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.88
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods53
▷ Static methods35.66%
▷ Public methods4177.36%
▷ Protected methods00.00%
▷ Private methods1222.64%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 1.67MB with 1.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/img/user-image-placeholder.png28.46KB0.00KB▼ 100.00%
assets/img/postalreadysaved.png20.52KB10.13KB▼ 50.63%
assets/img/settings.png24.25KB10.52KB▼ 56.62%
assets/img/edit-user.png38.52KB14.04KB▼ 63.55%
assets/img/savethispost.png36.32KB9.03KB▼ 75.13%