10% contentpress

Code Review | Contentpress

WordPress plugin Contentpress scored10%from 54 tests.

About plugin

  • Plugin page: contentpress
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Jul 14, 2014
  • Latest release: Apr 19, 2018
  • Number of updates: 22
  • Update frequency: every 62.6 days
  • Top authors: caselock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,421 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress::plugin_activation() should not be called statically

Server metrics [RAM: ▼1.24MB] [CPU: ▼44.88ms] Passed 4 tests

Analyzing server-side resources used by Contentpress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7319.74 ▼19.21
Dashboard /wp-admin2.77 ▼0.5317.67 ▼36.13
Posts /wp-admin/edit.php2.77 ▼0.5916.51 ▼38.08
Add New Post /wp-admin/post-new.php2.77 ▼3.1216.22 ▼81.89
Media Library /wp-admin/upload.php2.77 ▼0.4614.84 ▼23.42
Contentpress /wp-admin/options-general.php?page=contentpress2.7715.79

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
contentpress_page_name
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
contentpress_page_title
can_compress_scripts
contentpress_page_id

Browser metrics Passed 4 tests

A check of browser resources used by Contentpress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲14413.51 ▼0.698.99 ▲7.3843.06 ▼0.43
Dashboard /wp-admin2,208 ▲305.65 ▲0.0885.14 ▼16.8437.13 ▼6.56
Posts /wp-admin/edit.php2,110 ▲102.02 ▲0.0837.69 ▲1.2536.29 ▼3.41
Add New Post /wp-admin/post-new.php1,544 ▲1818.19 ▼5.02636.34 ▼61.8970.50 ▲11.47
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.08100.27 ▼14.3845.22 ▼7.02
Contentpress /wp-admin/options-general.php?page=contentpress1,3841.6923.2826.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress::contentpress_style() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=contentpress
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress::contentpress_style() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=contentpress
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress_Admin::contentpress_admin_menu() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=contentpress
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress_Admin::register_contentpress() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=contentpress
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Contentpress_Admin::contentpress_html_page() should not be called statically
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=contentpress
    • > Notice in wp-content/plugins/contentpress/options.php+165
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/contentpress/contentpress.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/contentpress/view/tags.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/contentpress/view/year.php on line 5
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/contentpress/view/tags.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/contentpress/view/authors.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/contentpress/view/blog.php:2
    • > PHP Notice
      Undefined variable: options_year in wp-content/plugins/contentpress/view/year.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/contentpress/view/alphabet.php:6
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/contentpress/view/tags.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function contentpress_e() in wp-content/plugins/contentpress/options.php:2
    • > PHP Notice
      Undefined variable: terms in wp-content/plugins/contentpress/view/categories.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 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
10 plugin tags: contentpress, comments, page, shortcode, image...

contentpress/contentpress.php 92% from 13 tests

"Contentpress" version 1.2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin953 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP119230711
CSS1561230
JavaScript201012

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods426.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
3 PNG files occupy 0.24MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png39.65KB14.03KB▼ 64.62%
screenshot-1.png177.28KB46.99KB▼ 73.49%
screenshot-3.png30.54KB10.75KB▼ 64.82%