84% content-parts

Code Review | Content Parts

WordPress plugin Content Parts scored84%from 54 tests.

About plugin

  • Plugin page: content-parts
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2011
  • Latest release: Jan 15, 2019
  • Number of updates: 43
  • Update frequency: every 67.8 days
  • Top authors: husobj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /13,623 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.66ms] Passed 4 tests

This is a short check of server-side resources used by Content Parts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.99 ▼3.25
Dashboard /wp-admin3.33 ▲0.0345.77 ▼5.10
Posts /wp-admin/edit.php3.38 ▲0.0347.93 ▲1.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.75 ▲6.53
Media Library /wp-admin/upload.php3.25 ▲0.0337.94 ▲0.45
Content Parts /wp-admin/themes.php?page=content_parts3.2130.94

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
content_parts_auto_format_post_types
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Content Parts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲7814.47 ▲0.091.76 ▼0.0343.74 ▼5.77
Dashboard /wp-admin2,219 ▲314.86 ▼1.02114.55 ▼1.4540.99 ▼1.64
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0839.44 ▲2.5935.66 ▲1.70
Add New Post /wp-admin/post-new.php1,536 ▲1923.31 ▲5.62666.10 ▲19.6354.69 ▼2.80
Media Library /wp-admin/upload.php1,392 ▲14.16 ▼0.1396.75 ▼1.7743.09 ▲0.82
Content Parts /wp-admin/themes.php?page=content_parts7952.0326.7531.09

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • content_parts_auto_format_post_types
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-parts/admin/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-parts/admin/editor.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/content-parts/content-parts.php:94
    • > PHP Fatal error
      Uncaught Error: Class 'Content_Parts_Plugin' not found in wp-content/plugins/content-parts/includes/content-parts.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: content, the_content, theme, templates, editor...

content-parts/content-parts.php Passed 13 tests

The main file in "Content Parts" v. 1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
96 characters long description:
Divide your post content into parts that you can use in different areas of your theme templates.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected655 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP6239489413
Markdown245097
SVG20281
JavaScript1261661
CSS1103

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.40
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods41
▷ Static methods2765.85%
▷ Public methods3790.24%
▷ Protected methods24.88%
▷ Private methods24.88%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
js/tinymce/plugins/contentparts/img/button.png0.23KB0.12KB▼ 47.26%