10% copernicus

Code Review | Copernicus

WordPress plugin Copernicus scored10%from 54 tests.

About plugin

  • Plugin page: copernicus
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9
  • WordPress version: 6.3.1
  • First release: May 9, 2014
  • Latest release: Feb 1, 2022
  • Number of updates: 32
  • Update frequency: every 88.3 days
  • Top authors: psoluch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,701 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/phpthumb.functions.php+1012
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.16MB] [CPU: ▼43.74ms] Passed 4 tests

Analyzing server-side resources used by Copernicus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6413.15 ▼31.34
Dashboard /wp-admin2.85 ▼0.4516.32 ▼29.02
Posts /wp-admin/edit.php2.85 ▼0.5019.78 ▼23.76
Add New Post /wp-admin/post-new.php2.85 ▼3.0316.54 ▼90.83
Media Library /wp-admin/upload.php2.85 ▼0.3815.47 ▼18.98
Add New /wp-admin/post-new.php?post_type=wp_log2.8516.09
Logs /wp-admin/edit.php?post_type=wp_log2.8518.02
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log2.8516.50
Translations /wp-admin/options-general.php?page=cp_translation2.8517.73

Server storage [IO: ▲3.26MB] [DB: ▲0.07MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • There were 3 files (0.00KB) illegally modified outside of "wp-content/plugins/copernicus/" and "wp-content/uploads/"
    • (new file) wp-content/cache/js/.empty
    • (new file) wp-content/cache/smarty/.empty
    • (new file) wp-content/cache/css/.empty
Filesystem: 703 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Copernicus
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲11113.44 ▼0.791.85 ▲0.3338.32 ▲0.75
Dashboard /wp-admin2,249 ▲574.91 ▼0.03110.01 ▼2.5540.45 ▲1.60
Posts /wp-admin/edit.php2,136 ▲472.24 ▲0.2140.92 ▲1.9435.65 ▼0.17
Add New Post /wp-admin/post-new.php1,550 ▲2622.24 ▼1.26671.92 ▲66.0347.16 ▼5.90
Media Library /wp-admin/upload.php1,431 ▲404.18 ▼0.0197.91 ▼6.1142.42 ▼0.50
Add New /wp-admin/post-new.php?post_type=wp_log2,2567.72180.5662.04
Logs /wp-admin/edit.php?post_type=wp_log1,0972.2131.3827.95
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log1,4382.3130.3429.91
Translations /wp-admin/options-general.php?page=cp_translation8281.8124.4924.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/copernicus/lib/core/class-language.php+152
    count(): Parameter must be an array or an object that implements Countable
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cp_translation
    • > Warning in wp-content/plugins/copernicus/lib/core/class-language.php+152
    count(): Parameter must be an array or an object that implements Countable
  • 60 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cp_translation
    • > Notice in wp-content/plugins/copernicus/lib/core/class-admin.php+132
    Trying to access array offset on value of type null

SRP 0% 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
Almost there! Just fix the following items
  • 14× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/phpThumb.demo.demo.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/phpThumb.demo.random.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/tests/bootstrap.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/phpThumb.demo.object.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/phpThumb.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/cache/source/index.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/phpThumb.demo.object.simple.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/index.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/index.php
    • > /wp-content/plugins/copernicus/lib/composer/vendor/james-heinrich/phpthumb/demo/phpThumb.demo.showpic.php
  • 281× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Assetic\\Test\\Filter\\FilterTestCase' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/CleanCssFilterTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_ParseTree' not found in wp-content/plugins/copernicus/lib/composer/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_dq.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Assetic\\Factory\\Resource\\ResourceInterface' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Assetic\\Filter\\FilterInterface' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/copernicus/lib/composer/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_while.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/copernicus/lib/composer/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/tests/Assetic/Test/Util/SassUtilsTest.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pcntl_signal() in wp-content/plugins/copernicus/lib/composer/vendor/symfony/process/Tests/SignalListener.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Assetic\\Filter\\BaseCssFilter' not found in wp-content/plugins/copernicus/lib/composer/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === copernicus === )
The official readme.txt might help

copernicus/copernicus.php 92% from 13 tests

The main PHP script in "Copernicus" version 1.3.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Git Repository: There should be no Git repositories present in your plugin

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected54,007 lines of code in 651 files:
LanguageFilesBlank linesComment linesLines of code
PHP5389,74722,70549,904
JavaScript168931,2851,536
Markdown193390968
JSON800544
CSS179595329
Sass15612242
Smarty2452200
HTML1300128
Twig160056
YAML214853
XML27543
LESS2103
Handlebars1001

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,052)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 236)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.60
▷ Minimum class complexity1.00
▷ Maximum class complexity1,052.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity236.00
Code structure
Namespaces33
Interfaces14
Traits0
Classes505
▷ Abstract classes377.33%
▷ Concrete classes46892.67%
▷ Final classes00.00%
Methods2,905
▷ Static methods1454.99%
▷ Public methods2,59989.47%
▷ Protected methods1896.51%
▷ Private methods1174.03%
Functions177
▷ Named functions13174.01%
▷ Anonymous functions4625.99%
Constants243
▷ Global constants197.82%
▷ Class constants22492.18%
▷ Public constants224100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/composer/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/fixtures/home.png0.18KB0.12KB▼ 35.87%
lib/composer/vendor/james-heinrich/phpthumb/images/alpha.png2.25KB2.46KB0.00%
lib/composer/vendor/james-heinrich/phpthumb/images/frame1.png13.95KB8.32KB▼ 40.38%
static/datepicker/css/calendar.png0.21KB0.15KB▼ 29.36%
static/datepicker/css/metallic/selected-date.png0.93KB0.13KB▼ 85.76%