2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-08-17 18:11:19 +08:00
wp-discourse/wp-discourse.php
Simon Cossar 43bd053450
Bump version to 2.2.4 (#404)
* Add base log classes

* Return maxFiles to normal level

* Use protected class variables for folder names in folder-manager

* Add unit tests for logger classes && various logger improvements

* Add log viewer

* Fix initialization sequence in LogViewer

* Add wp-discourse settings to plugin meta

* Remove metafile comments

* Add partial coverage and annotate LogViewer

* Add code coverage reporting and a tests readme

* Tests readme xdebug section formatting

* Add logging and tests to discourse-publish

This abstracts remote post components to make it possible to add consistent error and log handling. Also adds basic tests coverage for discourse-publish.

* Add successful publication test

* Add working tests for publish_after_create and publish_after_update

* Always remove test files and database upon install

* Cleanup copy and assertions for existing tests

* Final cleanup && verbose setting

* Improve structure of publish test

* Final tests, linting, security and cleanup

* PHP 7.0 Compatibility

* PHP 5.6 Compatibility

* JSHint fixes

* Update file-handler.php

* Update log viewer title

* Use older monolog and update file_handler function signatures

* Add nonce to other view_log action

* Namespace production composer packages and define build process

* Update COMPOSER.md

* Update FORMATTING.md

* Log viewer style, naming and log-refresh improvements

* Filter out all return type declarations during scoping

* JsHint: Don't use default params

* Update COMPOSER.md

* Copy fix

* Update scoper patchers notes

* Address syntax issues

- Remove >php7 syntax from non-required files
- Add phpcs pattern exclusions to phpcs.xml
- update formatting docs

* discourse-publish: address all phpcs notices and add more tests

Note: also added dealerdirect/phpcodesniffer-composer-installer to handle local requiring of codesniffer

* Handle all phpcs warnings in lib/logs

* Add todo: review phpcs exclusions to discourse-publish

* Monolog cleanup

- Remove unused monolog handlers, processors and formatters
- Add vendor_namespaced to excluded phpcs patterns

* Update CI versions to those used in composer

* Switch to using composer directly in CI actions

* Composer is packaged in shivammathur/setup-php

* Setup PHPCS via shivammathur/setup-php

* Incorrect tools key

* Use vendor/bin version of phpcs

* Install composer dependencies via ramsey/composer-install

* Update composer.lock to composer 2 and --ignore-platform-reqs

* Install lowest version of dependencies

* Move dependency-versions key

* Move composer-options key

* Exclude vendor directory from syntax checker

* Add vendor to jshintignore

* Update phpcs.xml to properly exclude js css and config files

* Address phpcs issues in log-viewer

* Fix remaining whitespace issues created in this PR

* Remove out of date sniffs and exclude specific code where necessary

* Final cleanup

* Properly escape html in log viewer

* Remove unnecessary verbiage from documentation

* Bump plugin's version to 2.2.4

Co-authored-by: Angus McLeod <angus@mcleod.org.au>
2021-05-11 15:31:24 -07:00

76 lines
3.7 KiB
PHP

<?php
/**
* Plugin Name: WP-Discourse
* Description: Use Discourse as a community engine for your WordPress blog
* Version: 2.2.4
* Author: Discourse
* Text Domain: wp-discourse
* Domain Path: /languages
* Author URI: https://github.com/discourse/wp-discourse
* Plugin URI: https://github.com/discourse/wp-discourse
* GitHub Plugin URI: https://github.com/discourse/wp-discourse
*
* @package WPDiscourse
*/
/** Copyright 2014 Civilized Discourse Construction Kit, Inc (team@discourse.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
define( 'WPDISCOURSE_PATH', plugin_dir_path( __FILE__ ) );
define( 'WPDISCOURSE_URL', plugins_url( '', __FILE__ ) );
define( 'MIN_WP_VERSION', '4.7' );
define( 'MIN_PHP_VERSION', '5.6.0' );
define( 'WPDISCOURSE_VERSION', '2.2.4' );
require_once WPDISCOURSE_PATH . 'lib/plugin-utilities.php';
require_once WPDISCOURSE_PATH . 'lib/template-functions.php';
require_once WPDISCOURSE_PATH . 'lib/utilities.php';
require_once WPDISCOURSE_PATH . 'lib/discourse.php';
require_once WPDISCOURSE_PATH . 'lib/discourse-comment.php';
require_once WPDISCOURSE_PATH . 'lib/discourse-publish.php';
require_once WPDISCOURSE_PATH . 'lib/sso-provider/sso.php';
require_once WPDISCOURSE_PATH . 'lib/sso-provider/discourse-sso.php';
require_once WPDISCOURSE_PATH . 'lib/webhook.php';
require_once WPDISCOURSE_PATH . 'lib/sync-discourse-user.php';
require_once WPDISCOURSE_PATH . 'lib/sync-discourse-topic.php';
require_once WPDISCOURSE_PATH . 'lib/email-notification.php';
require_once WPDISCOURSE_PATH . 'lib/sso-client/sso-client-base.php';
require_once WPDISCOURSE_PATH . 'lib/wordpress-email-verification.php';
require_once WPDISCOURSE_PATH . 'lib/discourse-comment-formatter.php';
require_once WPDISCOURSE_PATH . 'lib/sso-client/nonce.php';
require_once WPDISCOURSE_PATH . 'lib/sso-client/client.php';
require_once WPDISCOURSE_PATH . 'lib/sso-client/query-redirect.php';
require_once WPDISCOURSE_PATH . 'lib/shortcodes/sso-client.php';
require_once WPDISCOURSE_PATH . 'templates/html-templates.php';
require_once WPDISCOURSE_PATH . 'admin/discourse-sidebar/discourse-sidebar.php';
require_once WPDISCOURSE_PATH . 'vendor/autoload.php';
require_once WPDISCOURSE_PATH . 'lib/logs/logger.php';
require_once WPDISCOURSE_PATH . 'admin/admin.php';
new WPDiscourse\Discourse\Discourse();
$discourse_email_notification = new WPDiscourse\EmailNotification\EmailNotification();
$discourse_publish = new WPDiscourse\DiscoursePublish\DiscoursePublish( $discourse_email_notification );
new WPDiscourse\Admin\DiscourseSidebar( $discourse_publish );
$discourse_comment_formatter = new WPDiscourse\DiscourseCommentFormatter\DiscourseCommentFormatter();
new WPDiscourse\DiscourseComment\DiscourseComment( $discourse_comment_formatter );
new WPDiscourse\WordPressEmailVerification\WordPressEmailVerification( 'discourse_email_verification_key', 'discourse' );
new WPDiscourse\DiscourseSSO\DiscourseSSO();
new WPDiscourse\SyncDiscourseUser\SyncDiscourseUser();
new WPDiscourse\SyncDiscourseTopic\SyncDiscourseTopic();
new WPDiscourse\SSOClient\Client();
new WPDiscourse\SSOClient\QueryRedirect();
new WPDiscourse\SSOClient\SSOClientShortcode();