78% magee-custom-post

Code Review | Magee Custom Post

WordPress plugin Magee Custom Post scored 78% from 54 tests.

About plugin

  • Plugin page: magee-custom-post
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 5.9.2
  • First release: Aug 18, 2016
  • Latest release: Aug 31, 2016
  • Number of updates: 13
  • Update frequency: every 1.1 days
  • Top authors: magictheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 865 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼1.33MB] [CPU: ▼335.82ms] Passed 4 tests

Analyzing server-side resources used by Magee Custom Post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.12 ▼0.4017.25 ▼31.66
Dashboard /wp-admin3.03 ▼0.3815.52 ▼25.67
Posts /wp-admin/edit.php3.03 ▼0.6117.34 ▼35.16
Add New Post /wp-admin/post-new.php3.03 ▼3.9419.03 ▼1,250.79
Media Library /wp-admin/upload.php3.03 ▼0.2614.47 ▼9.65
Add Slide /wp-admin/post-new.php?post_type=mcp_slide3.0317.52
Features /wp-admin/edit.php?post_type=mcp_feature3.0316.38
Groups /wp-admin/edit-tags.php?taxonomy=mcp_client_group&post_type=mcp_client3.0315.75
Slides /wp-admin/edit.php?post_type=mcp_slide3.0314.90
Categories /wp-admin/edit-tags.php?taxonomy=mcp_team_group&post_type=mcp_team3.0316.12
Slider /wp-admin/edit-tags.php?taxonomy=mcp_slider&post_type=mcp_slide3.0314.99
Add Testimonial /wp-admin/post-new.php?post_type=mcp_testimonial3.0315.64
Add Client /wp-admin/post-new.php?post_type=mcp_client3.0316.57
Add Member /wp-admin/post-new.php?post_type=mcp_team3.0316.06
Add Portfolio /wp-admin/post-new.php?post_type=mcp_portfolio3.0314.32

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 67 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Magee Custom Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,393 ▲63517.94 ▲2.0011.97 ▲5.902.93 ▼0.02
Dashboard /wp-admin3,348 ▲4878.05 ▲1.83144.48 ▲4.60164.54 ▲3.08
Posts /wp-admin/edit.php3,193 ▲5025.16 ▲1.9380.25 ▲16.08151.92 ▲8.99
Add New Post /wp-admin/post-new.php1,884 ▲22322.01 ▲5.80379.07 ▼45.92160.56 ▲6.50
Media Library /wp-admin/upload.php1,993 ▲2985.42 ▼0.06107.49 ▼34.97191.80 ▲2.58
Add Slide /wp-admin/post-new.php?post_type=mcp_slide3,45210.16212.78251.35
Features /wp-admin/edit.php?post_type=mcp_feature1,8785.1175.91127.49
Groups /wp-admin/edit-tags.php?taxonomy=mcp_client_group&post_type=mcp_client2,1284.9175.65122.54
Slides /wp-admin/edit.php?post_type=mcp_slide1,8815.1077.23128.01
Categories /wp-admin/edit-tags.php?taxonomy=mcp_team_group&post_type=mcp_team2,1305.0076.08125.63
Slider /wp-admin/edit-tags.php?taxonomy=mcp_slider&post_type=mcp_slide2,1284.9677.09124.77
Add Testimonial /wp-admin/post-new.php?post_type=mcp_testimonial3,31210.11196.49240.18
Add Client /wp-admin/post-new.php?post_type=mcp_client2,6196.23103.43184.39
Add Member /wp-admin/post-new.php?post_type=mcp_team3,53510.17198.79301.66
Add Portfolio /wp-admin/post-new.php?post_type=mcp_portfolio3,47310.21194.27232.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/magee-custom-post/inc/metaboxes/init.php+701
    count(): Parameter must be an array or an object that implements Countable

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 84 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mcp_portfolio
    • > Warning in wp-content/plugins/magee-custom-post/inc/metaboxes/init.php+701
    count(): Parameter must be an array or an object that implements Countable

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
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-feature.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-portfolio.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-client.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/magee-custom-post/inc/metaboxes/metabox-options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-team.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-slider.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magee-custom-post/inc/post-type/class-testimonial.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/magee-custom-post/inc/metaboxes/init.php:6

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt is a good inspiration

magee-custom-post/magee-custom-post.php 92% from 13 tests

The main PHP script in "Magee Custom Post" version 1.0.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected18,568 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS11719810,411
JavaScript109165684,778
PHP147908392,406
SVG200973

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity32.23
▷ Minimum class complexity2.00
▷ Maximum class complexity136.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods164
▷ Static methods3823.17%
▷ Public methods16198.17%
▷ Protected methods21.22%
▷ Private methods10.61%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/metaboxes/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
inc/metaboxes/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
inc/metaboxes/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
inc/metaboxes/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/metaboxes/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%