73% magic-posts

Code Review | Magic Posts

WordPress plugin Magic Posts scored73%from 54 tests.

About plugin

  • Plugin page: magic-posts
  • Plugin version: 0.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Feb 17, 2013
  • Latest release: Feb 24, 2013
  • Number of updates: 26
  • Update frequency: every 0.3 days
  • Top authors: gbaptistas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,316 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼1.98ms] Passed 4 tests

This is a short check of server-side resources used by Magic Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1440.71 ▲1.41
Dashboard /wp-admin3.49 ▲0.1447.46 ▼15.62
Posts /wp-admin/edit.php3.61 ▲0.2552.12 ▲7.63
Add New Post /wp-admin/post-new.php6.09 ▲0.2092.86 ▲7.31
Media Library /wp-admin/upload.php3.42 ▲0.1835.64 ▼1.01
Magic Posts /wp-admin/options-general.php?page=magic-posts-settings3.3937.26

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
magic-posts_locale
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Magic Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7314.48 ▲0.101.68 ▼0.2440.00 ▼12.70
Dashboard /wp-admin2,214 ▲264.88 ▼0.94104.29 ▼4.1737.86 ▼0.77
Posts /wp-admin/edit.php2,100 ▲112.04 ▼0.0042.40 ▲5.0339.45 ▲7.78
Add New Post /wp-admin/post-new.php1,526 ▼722.82 ▼0.45627.77 ▼80.8753.57 ▼7.50
Media Library /wp-admin/upload.php1,396 ▲114.13 ▼0.1098.39 ▼3.2743.15 ▲0.65
Magic Posts /wp-admin/options-general.php?page=magic-posts-settings8321.8323.8329.47

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: 7 options
    • magic-posts_locale
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=magic-posts-settings
    • > 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=magic-posts-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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 take a closer look at the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/magic-posts/js/magic-posts-js.php
    • > /wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/string.php
    • > /wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/text.php
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/text.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/magic-posts/lib/magic-posts/settings/view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/editor.php:2
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/gallery.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Magic_Posts' not found in wp-content/plugins/magic-posts/lib/magic-posts/scaffolds.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/image.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Magic_Posts' not found in wp-content/plugins/magic-posts/lib/magic-posts/migrations.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Magic_Posts' not found in wp-content/plugins/magic-posts/lib/magic-posts/strings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/gallery.php:4
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/magic-posts/lib/magic-posts/helpers/meta-boxes/image.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: scaffolding, gallery, custom posts, images, custom taxonomies...

magic-posts/magic-posts.php Passed 13 tests

The main PHP file in "Magic Posts" ver. 0.0.8 adds more information about the plugin and also serves as the entry point for this plugin
47 characters long description:
Create Custom Post Types with simple scaffolds.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin1,596 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP245442901,471
JavaScript1550107
CSS111018

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity17.00
▷ Minimum class complexity6.00
▷ Maximum class complexity39.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods39
▷ Static methods1435.90%
▷ Public methods3692.31%
▷ Protected methods00.00%
▷ Private methods37.69%
Functions39
▷ Named functions512.82%
▷ Anonymous functions3487.18%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin