78% pixtypes

Code Review | PixTypes

WordPress plugin PixTypes scored 78% from 54 tests.

About plugin

  • Plugin page: pixtypes
  • Plugin version: 1.4.14
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.9-5.7.0
  • WordPress version: 5.9.2
  • First release: Mar 19, 2015
  • Latest release: Mar 5, 2021
  • Number of updates: 55
  • Update frequency: every 39.6 days
  • Top authors: euthelup (69.09%)babbardel (18.18%)pixelgrade (10.91%)vlad.olaru (7.27%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20,000+ active / 347,661 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▼284.02ms] Passed 4 tests

A check of server-side resources used by PixTypes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6367.18 ▲17.64
Dashboard /wp-admin3.99 ▲0.5842.43 ▲8.63
Posts /wp-admin/edit.php4.29 ▲0.6544.80 ▲5.77
Add New Post /wp-admin/post-new.php7.53 ▲0.55101.36 ▼1,157.48
Media Library /wp-admin/upload.php3.94 ▲0.6430.54 ▲6.99
All Projects /wp-admin/edit.php?post_type=pix_portfolio3.9930.42
Gallery Categories /wp-admin/edit-tags.php?taxonomy=pix_gallery_categories&post_type=pix_gallery3.9430.51
All Galleries /wp-admin/edit.php?post_type=pix_gallery3.9930.58
Add New /wp-admin/post-new.php?post_type=pix_gallery4.2753.25
PixTypes /wp-admin/options-general.php?page=pixtypes4.0029.35
Add New /wp-admin/post-new.php?post_type=pix_portfolio4.3252.14
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=pix_portfolio_categories&post_type=pix_portfolio3.9427.46

Server storage [IO: ▲1.64MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 225 new files
Database: no new tables, 1 new option
New WordPress options
pixtypes_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for PixTypes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,888 ▲13415.84 ▲0.136.27 ▼0.232.90 ▲0.37
Dashboard /wp-admin2,971 ▲1176.13 ▼0.06119.80 ▼13.93161.00 ▲1.77
Posts /wp-admin/edit.php2,774 ▲833.25 ▲0.0063.12 ▼0.63143.26 ▼1.93
Add New Post /wp-admin/post-new.php1,815 ▲15422.32 ▲6.79439.95 ▲20.92165.27 ▲8.14
Media Library /wp-admin/upload.php1,784 ▲895.53 ▲0.01140.91 ▼14.97196.35 ▼0.89
All Projects /wp-admin/edit.php?post_type=pix_portfolio1,4652.9360.69114.70
Gallery Categories /wp-admin/edit-tags.php?taxonomy=pix_gallery_categories&post_type=pix_gallery1,7082.7957.20115.49
All Galleries /wp-admin/edit.php?post_type=pix_gallery1,4682.9661.01111.86
Add New /wp-admin/post-new.php?post_type=pix_gallery2,6406.54103.93137.37
PixTypes /wp-admin/options-general.php?page=pixtypes1,1262.4453.78110.43
Add New /wp-admin/post-new.php?post_type=pix_portfolio3,29510.27200.92205.29
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=pix_portfolio_categories&post_type=pix_portfolio1,7052.7854.62111.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • This plugin does not fully uninstall, leaving 1 option in the database
    • pixtypes_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pixtypes/views/public.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_media() in wp-content/plugins/pixtypes/features/metaboxes/fields/gallery.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pixtypes/settings/post_types.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_media() in wp-content/plugins/pixtypes/features/metaboxes/fields/image.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpgrade_display_row_controls() in wp-content/plugins/pixtypes/features/metaboxes/fields/portfolio-gallery.php:23
    • > PHP Notice
      Trying to get property 'post_content' of non-object in wp-content/plugins/pixtypes/features/metaboxes/fields/pix_builder.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pixtypes/settings/taxonomies.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pixtypes/features/metaboxes/fields/pix_builder.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'pixtypes' not found in wp-content/plugins/pixtypes/views/admin.php:15
    • > PHP Notice
      Undefined variable: meta in wp-content/plugins/pixtypes/features/metaboxes/fields/portfolio-gallery.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_media() in wp-content/plugins/pixtypes/features/metaboxes/fields/playlist.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: builder, metadata, gallery, post-types, custom

pixtypes/pixtypes.php Passed 13 tests

"PixTypes" version 1.4.14's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
55 characters long description:
Custom post types and meta-boxes needed by your themes.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin22,952 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript651,8391,9607,475
CSS181,6611596,389
Sass177391264,417
PHP548571,3553,526
SVG602460
Markdown61160456
JSON500159
Bourne Shell124055
Ruby371615

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 167)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity24.44
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity4.98
▷ Minimum method complexity1.00
▷ Maximum method complexity167.00
Code structure
Namespaces0
Interfaces7
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods142
▷ Static methods3021.13%
▷ Public methods12588.03%
▷ Protected methods1711.97%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
35 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
features/metaboxes/images/row-versions/v8.png0.23KB0.23KB0.00%
features/metaboxes/images/row-versions/v7.png0.24KB0.25KB0.00%
features/metaboxes/images/ui-icons_888888_256x240.png3.62KB4.11KB0.00%
features/metaboxes/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
features/metaboxes/images/ui-icons_cd0a0a_256x240.png3.62KB4.11KB0.00%