10% magnet

Code Review | Magnet

WordPress plugin Magnet scored10%from 54 tests.

About plugin

  • Plugin page: magnet
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 5, 2016
  • Latest release: Jul 21, 2021
  • Number of updates: 31
  • Update frequency: every 58.4 days
  • Top authors: wpklangoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,395 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/magnet/class-wp-widget-klangoo.php+116
    Function create_function() is deprecated

Server metrics [RAM: ▼1.84MB] [CPU: ▼56.49ms] Passed 4 tests

Analyzing server-side resources used by Magnet
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.315.17 ▼41.08
Dashboard /wp-admin2.18 ▼1.176.50 ▼55.46
Posts /wp-admin/edit.php2.18 ▼1.186.88 ▼37.20
Add New Post /wp-admin/post-new.php2.18 ▼3.716.03 ▼92.21
Media Library /wp-admin/upload.php2.18 ▼1.056.22 ▼26.28

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_klangoo

Browser metrics Passed 4 tests

An overview of browser requirements for Magnet
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲4914.79 ▲0.611.84 ▼0.3839.95 ▼5.31
Dashboard /wp-admin2,225 ▲375.90 ▲1.01103.45 ▲0.8640.61 ▼2.76
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0038.05 ▲3.9835.22 ▼1.02
Add New Post /wp-admin/post-new.php1,533 ▲1423.09 ▼0.18662.47 ▲16.0551.92 ▼0.61
Media Library /wp-admin/upload.php1,398 ▲194.17 ▼0.0596.08 ▼7.1042.51 ▼0.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/magnet/class-wp-widget-klangoo.php+116
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_klangoo
    • widget_recent-posts
    • theysaidso_admin_options

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 | 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 items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magnet/class-wp-widget-klangoo.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/magnet/class-fake-page.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magnet/class-wp-widget-klangoo.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot showing the Magnet WordPress plugin installed and activated.), #2 (The second screenshot shows the settings screen of the \"Magnet\" widgets), #3 (The third screenshot shows a \"Magnet\" plugin placed inside the theme\'s Side Bar)
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

magnet/WP-klangoo.php 92% from 13 tests

The main file in "Magnet" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("magnet.php" instead of "WP-klangoo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin393 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP39690393

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity15.50
▷ Minimum class complexity12.00
▷ Maximum class complexity19.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin