Skip to content

Commit

Permalink
Rename JoostBlog to EmiliaProjects and JOOST_* to EMILIA_*
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jan 22, 2024
1 parent 77d94c0 commit 9743781
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
Ref: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-unit-test-classes
-->
<property name="custom_test_class_whitelist" type="array">
<element value="JoostBlog\WP\Comment\Tests\TestCase"/>
<element value="EmiliaProjects\WP\Comment\Tests\TestCase"/>
</property>

<!-- Provide the plugin specific prefix for use with namespace and hook names. -->
<property name="prefixes" type="array">
<element value="JoostBlog\WP\Comment"/>
<element value="EmiliaProjects\WP\Comment"/>
<element value="comment_hacks"/>
</property>
</properties>
Expand Down Expand Up @@ -110,7 +110,7 @@
<properties>
<property name="prefixes" type="array" extend="true">
<element value="yst_comment"/>
<element value="JOOST_COMMENT_HACKS"/>
<element value="EMILIA_COMMENT_HACKS"/>
</property>
</properties>
</rule>
Expand Down
18 changes: 9 additions & 9 deletions admin/admin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace JoostBlog\WP\Comment\Admin;
namespace EmiliaProjects\WP\Comment\Admin;

use WP_Comment;
use WP_Post;
use JoostBlog\WP\Comment\Inc\Hacks;
use EmiliaProjects\WP\Comment\Inc\Hacks;

/**
* Admin handling class.
Expand Down Expand Up @@ -187,7 +187,7 @@ public function meta_box_callback( $post ): void {
*
* @since 1.6.0
*/
$roles = \apply_filters( 'JoostBlog\WP\Comment\notification_roles', $roles );
$roles = \apply_filters( 'EmiliaProjects\WP\Comment\notification_roles', $roles );

\wp_dropdown_users(
[
Expand Down Expand Up @@ -230,16 +230,16 @@ public function enqueue(): void {

\wp_enqueue_style(
'emiliaprojects-comment-hacks-admin-css',
\plugins_url( 'admin/assets/css/dist/comment-hacks.css', \JOOST_COMMENT_HACKS_FILE ),
\plugins_url( 'admin/assets/css/dist/comment-hacks.css', \EMILIA_COMMENT_HACKS_FILE ),
[],
\JOOST_COMMENT_HACKS_VERSION
\EMILIA_COMMENT_HACKS_VERSION
);

\wp_enqueue_script(
'emiliaprojects-comment-hacks-admin-js',
\plugins_url( 'admin/assets/js/comment-hacks' . $min . '.js', \JOOST_COMMENT_HACKS_FILE ),
\plugins_url( 'admin/assets/js/comment-hacks' . $min . '.js', \EMILIA_COMMENT_HACKS_FILE ),
[],
\JOOST_COMMENT_HACKS_VERSION,
\EMILIA_COMMENT_HACKS_VERSION,
true
);
}
Expand Down Expand Up @@ -281,7 +281,7 @@ public function options_validate( array $input ): array {
$input[ $key ] = (int) $value;
break;
case 'version':
$input[ $key ] = JOOST_COMMENT_HACKS_VERSION;
$input[ $key ] = EMILIA_COMMENT_HACKS_VERSION;
break;
case 'comment_policy':
case 'clean_emails':
Expand Down Expand Up @@ -384,7 +384,7 @@ public function filter_plugin_actions( $links, $file ): array {
* Output the config page.
*/
public function config_page(): void {
require_once \JOOST_COMMENT_HACKS_PATH . 'admin/views/config-page.php';
require_once \EMILIA_COMMENT_HACKS_PATH . 'admin/views/config-page.php';

// Show the content of the options array when debug is enabled.
if ( \defined( 'WP_DEBUG' ) && \WP_DEBUG ) {
Expand Down
4 changes: 2 additions & 2 deletions admin/comment-parent.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Admin;
namespace EmiliaProjects\WP\Comment\Admin;

/**
* Comment parent handling class.
Expand All @@ -22,7 +22,7 @@ public function __construct() {
* @param object $comment The comment object.
*/
public function comment_parent_box( $comment ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Param used in included file.
require_once \JOOST_COMMENT_HACKS_PATH . 'admin/views/comment-parent-box.php';
require_once \EMILIA_COMMENT_HACKS_PATH . 'admin/views/comment-parent-box.php';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions admin/views/config-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Config page admin view.
*/

use JoostBlog\WP\Comment\Inc\Hacks;
use EmiliaProjects\WP\Comment\Inc\Hacks;

?>
<div class="wrap">
Expand Down Expand Up @@ -316,4 +316,4 @@
*
* @since 1.6.0
*/
do_action( 'JoostBlog\WP\Comment\admin_footer' );
do_action( 'EmiliaProjects\WP\Comment\admin_footer' );
14 changes: 7 additions & 7 deletions comment-hacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

use JoostBlog\WP\Comment\Inc\Hacks;
use EmiliaProjects\WP\Comment\Inc\Hacks;

/**
* Used for version checks.
*/
define( 'JOOST_COMMENT_HACKS_VERSION', '1.9.4' );
define( 'EMILIA_COMMENT_HACKS_VERSION', '1.9.4' );

/**
* Used for asset embedding.
*/
define( 'JOOST_COMMENT_HACKS_FILE', __FILE__ );
define( 'EMILIA_COMMENT_HACKS_FILE', __FILE__ );

if ( ! defined( 'JOOST_COMMENT_HACKS_PATH' ) ) {
define( 'JOOST_COMMENT_HACKS_PATH', plugin_dir_path( __FILE__ ) );
if ( ! defined( 'EMILIA_COMMENT_HACKS_PATH' ) ) {
define( 'EMILIA_COMMENT_HACKS_PATH', plugin_dir_path( __FILE__ ) );
}

/* ***************************** CLASS AUTOLOADING *************************** */
if ( file_exists( JOOST_COMMENT_HACKS_PATH . 'vendor/autoload.php' ) ) {
require JOOST_COMMENT_HACKS_PATH . 'vendor/autoload.php';
if ( file_exists( EMILIA_COMMENT_HACKS_PATH . 'vendor/autoload.php' ) ) {
require EMILIA_COMMENT_HACKS_PATH . 'vendor/autoload.php';
}

new Hacks();
2 changes: 1 addition & 1 deletion grunt/config/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
options: {
// Reason for disable: it triggers on a \x0a character we can't find in the string below.
// eslint-disable-next-line no-control-regex
regEx: new RegExp( "/(define\( \'JOOST_COMMENT_HACKS_VERSION\'\, \')(\d+(\.\d+){0.3})([^\.^\'\d]?.*?)(\' \);\n)/" ),
regEx: new RegExp( "/(define\( \'EMILIA_COMMENT_HACKS_VERSION\'\, \')(\d+(\.\d+){0.3})([^\.^\'\d]?.*?)(\' \);\n)/" ),
preVersionMatch: "$1",
postVersionMatch: "$5",
},
Expand Down
2 changes: 1 addition & 1 deletion inc/clean-emails.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

/**
* Clean the emails.
Expand Down
2 changes: 1 addition & 1 deletion inc/email-links.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

/**
* Manage links in comments.
Expand Down
2 changes: 1 addition & 1 deletion inc/forms.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

/**
* Add comment note.
Expand Down
12 changes: 6 additions & 6 deletions inc/hacks.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

use JoostBlog\WP\Comment\Admin\Admin;
use EmiliaProjects\WP\Comment\Admin\Admin;

/**
* Main comment hacks functionality.
Expand All @@ -24,7 +24,7 @@ class Hacks {
*/
public function __construct() {
$this->options = self::get_options();
if ( ! isset( $this->options['version'] ) || \JOOST_COMMENT_HACKS_VERSION > $this->options['version'] ) {
if ( ! isset( $this->options['version'] ) || \EMILIA_COMMENT_HACKS_VERSION > $this->options['version'] ) {
$this->set_defaults();
$this->upgrade();
}
Expand Down Expand Up @@ -110,7 +110,7 @@ public function comment_redirect( string $url, \WP_Comment $comment ): string {
*
* @since 1.6.0
*/
$url = \apply_filters( 'JoostBlog\WP\Comment\redirect', $url, $comment );
$url = \apply_filters( 'EmiliaProjects\WP\Comment\redirect', $url, $comment );
}
}

Expand Down Expand Up @@ -154,7 +154,7 @@ private function upgrade(): void {

if ( ! isset( $this->options['version'] ) ) {
$this->options['clean_emails'] = true;
$this->options['version'] = \JOOST_COMMENT_HACKS_VERSION;
$this->options['version'] = \EMILIA_COMMENT_HACKS_VERSION;
}

if ( ! isset( $this->options['disable_email_all_commenters'] ) ) {
Expand Down Expand Up @@ -209,6 +209,6 @@ public function set_defaults(): void {
* Load plugin textdomain.
*/
public function load_text_domain(): void {
\load_plugin_textdomain( 'comment-hacks', false, \dirname( \plugin_basename( \JOOST_COMMENT_HACKS_FILE ) ) . '/languages' );
\load_plugin_textdomain( 'comment-hacks', false, \dirname( \plugin_basename( \EMILIA_COMMENT_HACKS_FILE ) ) . '/languages' );
}
}
2 changes: 1 addition & 1 deletion inc/length.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

/**
* Checks the comments for allowed length.
Expand Down
2 changes: 1 addition & 1 deletion inc/notifications.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Inc;
namespace EmiliaProjects\WP\Comment\Inc;

/**
* Notifications about comments.
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Tests;
namespace EmiliaProjects\WP\Comment\Tests;

use Yoast\WPTestUtils\WPIntegration;

Expand Down
10 changes: 5 additions & 5 deletions tests/inc/clean-emails-test.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace JoostBlog\WP\Comment\Tests\Inc;
namespace EmiliaProjects\WP\Comment\Tests\Inc;

use stdClass;
use JoostBlog\WP\Comment\Inc\Clean_Emails;
use JoostBlog\WP\Comment\Tests\TestCase;
use EmiliaProjects\WP\Comment\Inc\Clean_Emails;
use EmiliaProjects\WP\Comment\Tests\TestCase;

/**
* Test class to test the Clean_Emails class.
Expand All @@ -14,7 +14,7 @@ class Clean_Emails_Test extends TestCase {
/**
* Tests class constructor.
*
* @covers \JoostBlog\WP\Comment\Inc\Clean_Emails::__construct
* @covers \EmiliaProjects\WP\Comment\Inc\Clean_Emails::__construct
*/
public function test__construct() {
$instance = new Clean_Emails();
Expand Down Expand Up @@ -45,7 +45,7 @@ public function test__construct() {
* Test setting the content type header for comment emails to "text/html".
*
* @dataProvider data_comment_email_headers
* @covers \JoostBlog\WP\Comment\Inc\Clean_Emails::comment_email_headers
* @covers \EmiliaProjects\WP\Comment\Inc\Clean_Emails::comment_email_headers
*
* @param mixed $headers The initial message headers.
* @param string $expected The expected function return value.
Expand Down
2 changes: 1 addition & 1 deletion tests/testcase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace JoostBlog\WP\Comment\Tests;
namespace EmiliaProjects\WP\Comment\Tests;

use Yoast\WPTestUtils\WPIntegration\TestCase as TestUtils_TestCase;

Expand Down

0 comments on commit 9743781

Please sign in to comment.