10% wskr-posts

Code Review | WSKR Posts

WordPress plugin WSKR Posts scored10%from 54 tests.

About plugin

  • Plugin page: wskr-posts
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2021
  • Latest release: Mar 21, 2021
  • Number of updates: 51
  • Update frequency: every 0.8 days
  • Top authors: wskr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /483 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▼0.36MB] [CPU: ▼14.11ms] Passed 4 tests

Analyzing server-side resources used by WSKR Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3442.79 ▲7.59
Dashboard /wp-admin3.65 ▲0.3447.50 ▲0.22
Posts /wp-admin/edit.php3.70 ▲0.3451.17 ▲4.35
Add New Post /wp-admin/post-new.php3.48 ▼2.4138.66 ▼63.34
Media Library /wp-admin/upload.php3.51 ▲0.2836.47 ▲2.34
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page3.5134.73

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 10 new options
New WordPress options
custom_wskr_member_role_version
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
category_children
wskr_confirmation_page
widget_recent-comments
wskr_login_page

Browser metrics Passed 4 tests

This is an overview of browser requirements for WSKR Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲14213.53 ▼0.838.60 ▲6.7639.99 ▼4.36
Dashboard /wp-admin2,202 ▲255.60 ▼0.0186.99 ▲0.3081.14 ▲43.66
Posts /wp-admin/edit.php2,140 ▲402.00 ▲0.0135.55 ▼0.3832.73 ▼0.13
Add New Post /wp-admin/post-new.php6,256 ▲4,71721.12 ▼1.95855.99 ▲206.65106.02 ▲50.60
Media Library /wp-admin/upload.php1,425 ▲254.25 ▲0.05111.60 ▼6.8947.34 ▲1.08
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page1,4452.1428.7927.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 10 options in the database
    • custom_wskr_member_role_version
    • wskr_login_page
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wskr_confirmation_page
    • widget_recent-posts
    • can_compress_scripts
    • category_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wskr-posts/admin/partials/wskr-admin-display.php
    • > /wp-content/plugins/wskr-posts/public/partials/wskr-public-display.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/wskr-posts/templates/header-wskr.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_pages() in wp-content/plugins/wskr-posts/admin/partials/wskr-plugin-setting.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_wskr_header() in wp-content/plugins/wskr-posts/templates/wskr-login-template.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/wskr-posts/templates/wskr-header.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_wskr_header() in wp-content/plugins/wskr-posts/admin/templates/wskr-login-template.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_wskr_header() in wp-content/plugins/wskr-posts/admin/templates/wskr-template.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_footer() in wp-content/plugins/wskr-posts/templates/footer-wskr.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 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: protect, wskr, permission, revenue, access...

wskr-posts/wskr.php 85% from 13 tests

The main PHP file in "WSKR Posts" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("wskr-posts.php" instead of "wskr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected3,109 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP233271,0351,524
JavaScript412883884
CSS38616701

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity24.89
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods78
▷ Static methods22.56%
▷ Public methods5367.95%
▷ Protected methods00.00%
▷ Private methods2532.05%
Functions18
▷ Named functions1161.11%
▷ Anonymous functions738.89%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/icon/wskr-icon.png1.19KB0.55KB▼ 53.45%
admin/assets/images/powered-by-wskr.png6.02KB2.90KB▼ 51.85%
public/assets/images/powered-by-wskr.png6.02KB2.90KB▼ 51.85%