83% mycred-for-totalpoll

Code Review | myCred for TotalPoll

WordPress plugin myCred for TotalPoll scored83%from 54 tests.

About plugin

  • Plugin page: mycred-for-totalpoll
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 10, 2020
  • Latest release: Nov 7, 2023
  • Number of updates: 25
  • Update frequency: every 55.0 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,651 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.02ms] Passed 4 tests

Analyzing server-side resources used by myCred for TotalPoll
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0536.37 ▼6.15
Dashboard /wp-admin3.35 ▲0.0446.86 ▼6.68
Posts /wp-admin/edit.php3.47 ▲0.1151.24 ▲2.00
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.47 ▼5.60
Media Library /wp-admin/upload.php3.27 ▲0.0432.43 ▼1.66

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for myCred for TotalPoll
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.15 ▼0.071.68 ▲0.1040.59 ▼5.66
Dashboard /wp-admin2,195 ▲155.58 ▼0.0791.34 ▲3.7843.49 ▲5.02
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.0239.21 ▲3.7234.99 ▼0.20
Add New Post /wp-admin/post-new.php1,535 ▼025.44 ▲0.58604.87 ▼10.4463.93 ▲2.64
Media Library /wp-admin/upload.php1,400 ▲64.18 ▲0.0194.99 ▼4.1742.44 ▼1.29

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mycred-for-totalpoll/mycred-totalpoll.php:90

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 90% 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
5 plugin tags: contest, mycred, total poll, polls, poll

mycred-for-totalpoll/mycred-totalpoll.php 77% from 13 tests

The main PHP script in "myCred for TotalPoll" version 1.0.8 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("mycred-for-totalpoll.php" instead of "mycred-totalpoll.php")
  • Requires at least: Periods and digits should be used for the required version number (ex. "7.0" instead of "WP 4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin246 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP262121182
PO File2181864

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.50
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods17
▷ Static methods15.88%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin