77% content-magnets

Code Review | Content Magnets

WordPress plugin Content Magnets scored77%from 54 tests.

About plugin

  • Plugin page: content-magnets
  • Plugin version: 0.0.3.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: Aug 31, 2022
  • Number of updates: 25
  • Update frequency: every 34.2 days
  • Top authors: contentmagnets (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /880 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
Installer ran successfully

Server metrics [RAM: ▼0.49MB] [CPU: ▼23.19ms] Passed 4 tests

This is a short check of server-side resources used by Content Magnets
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1436.55 ▼5.10
Dashboard /wp-admin3.59 ▲0.2849.35 ▼0.06
Posts /wp-admin/edit.php3.54 ▲0.1839.42 ▼10.80
Add New Post /wp-admin/post-new.php3.34 ▼2.5528.74 ▼76.81
Media Library /wp-admin/upload.php3.51 ▲0.2841.80 ▲7.78
Settings /wp-admin/admin.php?page=content-magnets_settings3.5134.92
Magnets /wp-admin/edit.php?post_type=cmg_magnet3.5539.13
Subscribers /wp-admin/edit.php?post_type=cmg_capture3.5238.52

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Magnets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,197 ▲45113.64 ▼0.616.06 ▲4.3539.50 ▼1.29
Dashboard /wp-admin2,506 ▲3184.92 ▼0.99106.66 ▲1.4439.75 ▼2.54
Posts /wp-admin/edit.php2,360 ▲2712.07 ▲0.0841.71 ▲0.8235.68 ▲0.47
Add New Post /wp-admin/post-new.php6,404 ▲4,87622.72 ▼0.41829.96 ▲219.6339.09 ▼24.79
Media Library /wp-admin/upload.php1,795 ▲4074.25 ▲0.0598.82 ▼0.4037.57 ▼6.15
Settings /wp-admin/admin.php?page=content-magnets_settings1,3782.3939.8740.38
Magnets /wp-admin/edit.php?post_type=cmg_magnet1,3351.9934.7628.76
Subscribers /wp-admin/edit.php?post_type=cmg_capture1,2952.1138.0530.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/edit.php?post_type=cmg_capture
    • > Notice in wp-content/plugins/content-magnets/lib/class.cmg.php+96
    Undefined index: trash

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/content-magnets/view/admin/cmg_settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-magnets/lib/custom_post_types.php:118
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/content-magnets/lib/class.cmg-routes.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/content-magnets/content-magnets.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Too many tags (43 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

content-magnets/content-magnets.php 77% from 13 tests

The main PHP file in "Content Magnets" ver. 0.0.3.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires PHP: Required version must match the one declared in readme.txt ("5.6" instead of "5.2")
  • Description: Please keep the plugin description shorter than 140 characters (currently 220 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("4.5.0" instead of "4.0")

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 plugin8,255 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS673413,144
SVG2012,680
PHP103082591,489
JavaScript48648942

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity31.25
▷ Minimum class complexity5.00
▷ Maximum class complexity78.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods61
▷ Static methods5793.44%
▷ Public methods5895.08%
▷ Protected methods00.00%
▷ Private methods34.92%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants6
▷ Global constants6100.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
No PNG images were found in this plugin