78% wp-polr

Code Review | Polr WordPress Plugin

WordPress plugin Polr WordPress Plugin scored 78% from 54 tests.

About plugin

  • Plugin page: wp-polr
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.3-5.5.3
  • WordPress version: 6.3.1
  • First release: Jun 6, 2017
  • Latest release: Dec 7, 2020
  • Number of updates: 25
  • Update frequency: every 51.4 days
  • Top authors: aldakur (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 834 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.67MB] [CPU: ▼18.54ms] Passed 4 tests

Analyzing server-side resources used by Polr WordPress Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.42 ▼6.74
Dashboard /wp-admin3.34 ▲0.0449.68 ▼3.30
Posts /wp-admin/edit.php3.31 ▼0.0541.69 ▼5.52
Add New Post /wp-admin/post-new.php3.18 ▼2.7138.13 ▼58.58
Media Library /wp-admin/upload.php3.27 ▲0.0333.66 ▲0.61
Polr /wp-admin/options-general.php?page=polr3.2130.96

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Polr WordPress Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▲0.071.80 ▼0.0544.93 ▲3.93
Dashboard /wp-admin2,210 ▲225.87 ▲0.96108.60 ▼7.2137.13 ▼6.46
Posts /wp-admin/edit.php2,102 ▲131.99 ▼0.0639.23 ▼2.5935.94 ▼3.53
Add New Post /wp-admin/post-new.php6,468 ▲4,94920.47 ▼2.66922.50 ▲272.7856.38 ▲9.43
Media Library /wp-admin/upload.php1,395 ▲44.18 ▼0.0598.52 ▼2.4343.36 ▼0.01
Polr /wp-admin/options-general.php?page=polr6921.146.7121.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=polr
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=polr
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=polr
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/wp-polr/admin/settings-page.php on line 31 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/wp-polr/admin/settings-page.php(31): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): polr_plugin_options()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-polr/admin/admin-menu.php
    • > /wp-content/plugins/wp-polr/admin/polr-metabox.php
    • > /wp-content/plugins/wp-polr/polr.php
    • > /wp-content/plugins/wp-polr/admin/admin-all-posts-page.php
    • > /wp-content/plugins/wp-polr/admin/settings-page.php
    • > /wp-content/plugins/wp-polr/admin/plugins-page.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: polr, open-source, link-shortener, free-software, shortener

wp-polr/polr.php 92% from 13 tests

The principal PHP file in "Polr WordPress Plugin" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-polr.php" instead of "polr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin258 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP86495154
PO File2242884
JavaScript13020

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin