73% cubewp-framework

Code Review | CubeWP - All-in-One Dynamic Content Framework

WordPress plugin CubeWP - All-in-One Dynamic Content Framework scored73%from 54 tests.

About plugin

  • Plugin page: cubewp-framework
  • Plugin version: 1.1.12
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2022
  • Latest release: Nov 22, 2023
  • Number of updates: 161
  • Update frequency: every 2.6 days
  • Top authors: cubewp1211 (94.41%)ahmadcheema (3.73%)teamcubewp (3.11%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /14,618 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.50MB] [CPU: ▲27.51ms] Passed 4 tests

This is a short check of server-side resources used by CubeWP - All-in-One Dynamic Content Framework
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.77 ▲2.3066.03 ▲21.52
Dashboard /wp-admin5.89 ▲2.5885.53 ▲32.40
Posts /wp-admin/edit.php5.92 ▲2.5675.70 ▲23.55
Add New Post /wp-admin/post-new.php9.10 ▲3.21135.36 ▲32.58
Media Library /wp-admin/upload.php5.80 ▲2.5777.21 ▲41.66
CubeWP Import /wp-admin/admin.php?page=cubewp-import5.7172.94
User Dashboard /wp-admin/admin.php?page=cubewp-user-dashboard5.7262.97
User Custom Fields /wp-admin/admin.php?page=user-custom-fields5.8963.16
User Signup Form /wp-admin/admin.php?page=cubewp-user-registration-form5.7262.19
Taxonomies /wp-admin/admin.php?page=cubewp-taxonomies5.8467.49
Taxonomy Custom Fields /wp-admin/admin.php?page=taxonomy-custom-fields5.8064.40
Post Types Form /wp-admin/admin.php?page=cubewp-post-types-form5.7261.45
CubeWP Export /wp-admin/admin.php?page=cubewp-export5.7261.69
Settings Custom Fields /wp-admin/admin.php?page=settings-custom-fields5.8860.05
Single-Post Editor /wp-admin/admin.php?page=cubewp-single-layout5.7262.80

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 370 new files
Database: 1 new table, 10 new options
New tables
wp_cube_relationships
New WordPress options
can_compress_scripts
widget_recent-posts
widget_cubewp_terms_widget
db_upgraded
widget_theysaidso_widget
widget_cubewp_posts_widget
cwpOptions
theysaidso_admin_options
cubewp_framework_installed_on
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for CubeWP - All-in-One Dynamic Content Framework
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,243 ▲48113.75 ▼0.588.92 ▲7.2036.13 ▼9.78
Dashboard /wp-admin2,499 ▲3225.62 ▲0.0397.44 ▲5.4577.00 ▲35.39
Posts /wp-admin/edit.php2,423 ▲3232.05 ▲0.1040.17 ▼0.1037.58 ▲2.30
Add New Post /wp-admin/post-new.php2,011 ▲48524.18 ▲1.17726.49 ▲95.6827.41 ▼20.07
Media Library /wp-admin/upload.php1,719 ▲3194.10 ▼0.05120.22 ▲24.7948.94 ▲8.76
CubeWP Import /wp-admin/admin.php?page=cubewp-import1,3891.7831.5676.89
User Dashboard /wp-admin/admin.php?page=cubewp-user-dashboard1,4991.7830.3749.69
User Custom Fields /wp-admin/admin.php?page=user-custom-fields1,5932.4936.2255.64
User Signup Form /wp-admin/admin.php?page=cubewp-user-registration-form1,4131.8931.1742.73
Taxonomies /wp-admin/admin.php?page=cubewp-taxonomies1,7363.4352.7384.38
Taxonomy Custom Fields /wp-admin/admin.php?page=taxonomy-custom-fields1,5692.4034.3049.60
Post Types Form /wp-admin/admin.php?page=cubewp-post-types-form1,4161.9031.4741.44
CubeWP Export /wp-admin/admin.php?page=cubewp-export1,4431.9037.7347.24
Settings Custom Fields /wp-admin/admin.php?page=settings-custom-fields1,5392.4035.7150.48
Single-Post Editor /wp-admin/admin.php?page=cubewp-single-layout1,5141.9033.4350.41

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 successfully, leaving 1 table in the database
    • wp_cube_relationships
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_cubewp_terms_widget
    • widget_cubewp_posts_widget
    • widget_recent-posts
    • db_upgraded
    • cwpOptions
    • can_compress_scripts
    • cubewp_framework_installed_on
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CubeWp_Custom_Fields_Processor' not found in wp-content/plugins/cubewp-framework/cube/modules/users/class-cubewp-user-custom-fields-ui.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cubewp-framework/cube/modules/list-tables/class-cubewp-post-types-list-table.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CubeWp_Frontend' not found in wp-content/plugins/cubewp-framework/cube/fields/frontend/cubewp-frontend-image-field.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cubewp-framework/cube/modules/list-tables/class-cubewp-post-types-custom-fields-table.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cubewp-framework/cube/modules/list-tables/class-cubewp-settings-custom-fields-table.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cubewp-framework/cube/modules/list-tables/class-cubewp-user-custom-fields-table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cubewp-framework/cube/templates/archive-cpt.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/cubewp-framework/cube/templates/template-library.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/cubewp-framework/cube/templates/welcome.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cubewp-framework/cube/templates/author.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid URI: "NA"
  • Tags: You are using too many tags: 37 tag instead of maximum 10
The official readme.txt is a good inspiration

cubewp-framework/cube.php 92% from 13 tests

The main PHP file in "CubeWP - All-in-One Dynamic Content Framework" ver. 1.1.12 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cubewp-framework.php" instead of "cube.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected45,374 lines of code in 219 files:
LanguageFilesBlank linesComment linesLines of code
PHP1633,6946,33226,753
CSS231,06417211,773
JavaScript287474266,580
SVG200153
JSON3160115

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 101)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity27.55
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity101.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes153
▷ Abstract classes00.00%
▷ Concrete classes153100.00%
▷ Final classes21.31%
Methods1,135
▷ Static methods35030.84%
▷ Public methods90779.91%
▷ Protected methods796.96%
▷ Private methods14913.13%
Functions131
▷ Named functions12796.95%
▷ Anonymous functions43.05%
Constants36
▷ Global constants925.00%
▷ Class constants2775.00%
▷ Public constants27100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
135 PNG files occupy 2.71MB with 1.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cube/assets/admin/images/welcome-dashboard/cwp-logo.png1.70KB0.97KB▼ 43.01%
cube/assets/lib/pretty-photo/images/prettyPhoto/facebook/btnNext.png0.83KB0.57KB▼ 30.77%
cube/assets/admin/images/cube-logo.png29.91KB9.56KB▼ 68.05%
cube/assets/lib/pretty-photo/images/prettyPhoto/light_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
cube/assets/admin/images/p_logo.png10.48KB4.88KB▼ 53.43%