Skip to content

Commit

Permalink
Merge pull request #374 from publishpress/release-v3.12.0
Browse files Browse the repository at this point in the history
Release v3.12.0
  • Loading branch information
andergmartins authored Feb 23, 2021
2 parents 13756a4 + aadac75 commit 92ed243
Show file tree
Hide file tree
Showing 46 changed files with 999 additions and 429 deletions.
4 changes: 3 additions & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

use PublishPressBuilder\PackageBuilderTasks;

/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \PublishPressBuilder\PackageBuilderTasks
class RoboFile extends PackageBuilderTasks
{
public function __construct()
{
Expand Down
Binary file modified assets_wp/banner-1544x500.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/banner-772x250.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets_wp/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
350 changes: 180 additions & 170 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
defined('ABSPATH') or die('No direct script access allowed.');

if (!defined('PP_AUTHORS_VERSION')) {
define('PP_AUTHORS_VERSION', '3.11.0');
define('PP_AUTHORS_VERSION', '3.12.0');
define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php');
define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php'));
define('PP_AUTHORS_MODULES_PATH', PP_AUTHORS_BASE_PATH . 'src/modules/');
Expand Down
4 changes: 3 additions & 1 deletion deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/

// Class aliases for backward compatibility
use MultipleAuthors\Classes\Authors_Iterator;

class_alias(MultipleAuthors\Plugin::class, PP_Multiple_authors_plugin::class);
class_alias(MultipleAuthors\Container::class, PublishPress\Addon\Multiple_authors\Container::class);
class_alias(MultipleAuthors\Factory::class, PublishPress\Addon\Multiple_authors\Factory::class);
Expand All @@ -29,7 +31,7 @@ class_alias(
PublishPress\Addon\Multiple_authors\Classes\Authors_Iterator::class
);
class_alias(
\MultipleAuthors\Classes\Authors_Iterator::class,
Authors_Iterator::class,
'Multiple_authors_iterator'
);
class_alias(MultipleAuthors\Classes\CLI::class, PublishPress\Addon\Multiple_authors\Classes\CLI::class);
Expand Down
2 changes: 1 addition & 1 deletion publishpress-authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: PublishPress Authors allows you to add multiple authors and guest authors to WordPress posts
* Author: PublishPress
* Author URI: https://publishpress.com
* Version: 3.11.0
* Version: 3.12.0
* Text Domain: publishpress-authors
*
* ------------------------------------------------------------------------------
Expand Down
23 changes: 22 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: multiple authors, authors, guest authors, author fields, author layouts
Requires at least: 4.7
Requires PHP: 5.6
Tested up to: 5.6
Stable tag: 3.11.0
Stable tag: 3.12.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -108,6 +108,27 @@ There are two ways to install the PublishPress Authors plugin:

== Changelog ==

= [3.12.0] - 2021-02-23 =

* Added: Added filters for customizing the byline on Elementor skins: publishpress_authors_elementor_posts_skin_cards_byline, publishpress_authors_elementor_posts_skin_classic_byline, #335;
* Changed: Improved the style for the Boxed layout, #332;
* Changed: Automatically sync the author URL with the user nicename when the user is saved, #53;
* Fixed: Fixed encoding of UTF-8 chars in the Author URL column in the Authors list, #352;
* Fixed: Fixed PHP warnings on Nested Pages plugin, #345;
* Fixed: Improved performance on author pages reducing the number of database queries only looking for an author taxonomy if a user was not found;
* Fixed: Fix compatibility with the SEO Framework archive title for guest authors, #351;
* Fixed: Fixed the query to list authors considering only published posts, #350;
* Fixed: Fixed warning about undefined index: ID, the rest-api.php file, #342;
* Fixed: Fix PublishPress notifications for guest authors with email address, #349;
* Fixed: Fix the PHP warning "Call to a member function get_user_object() on bool", #348;
* Fixed: Duplicated queries caused by multiple calls to "get_user_by" for the same slug, #343;
* Fixed: Fix the authors list widget form removing not used field, #339;
* Fixed: Fix error: "Twig file not found" for shortcodes in the Pro version using a custom layout. And avoid to show the authors twice if Free and Pro are activated, #336;
* Fixed: Fix compatibility with WP Engine object cache, #327;
* Fixed: Fixed the invalid taxonomy error message, #326;
* Fixed: Improved performance on author pages reducing the number of database queries only looking for an author taxonomy if a user was not found;
* Fixed: Fix the Authors List widget title alignment wrapping it on a H2 tag;

= [3.11.0] - 2021-01-25 =

* Added: Added fields for setting the plural and single title to the author box and widget, #75;
Expand Down
88 changes: 75 additions & 13 deletions src/assets/css/multiple-authors-widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
position: relative;
min-height: 35px;
line-height: 35px;
border-bottom: 1px solid #dddddd;
border-top: 1px solid #dddddd;
border-bottom: 1px solid #dddddd;
border-top: 1px solid #dddddd;
border-bottom: 1px solid #999;
border-top: 1px solid #999;
border-bottom: 1px solid #999;
border-top: 1px solid #999;
padding: 0.5em 0;
margin: -1px 0 0 0;
}
Expand All @@ -31,19 +31,25 @@
list-style: none;
position: relative;
min-height: 120px;
border: 1px solid #dddddd;
padding: 1em;
border: 1px solid #999;
padding: 1.5em;
margin-bottom: 1em;
margin-left: 0;
}

.pp-multiple-authors-layout-boxed .avatar,
.pp-multiple-authors-layout-boxed .photo {
position: static;
float: left;
margin-right: 1em;
width: 80px;
height: 80px;
min-height: 80px;
height: auto;
border-radius: 50%;
}

.pp-multiple-authors-layout-boxed .multiple-authors-description {
margin: 10px 0 20px;
}

.pp-multiple-authors-layout-boxed .multiple-authors-name a {
margin-bottom: 0;
}

.pp-multiple-authors-layout-boxed a {
Expand All @@ -52,6 +58,46 @@
display: inline-block;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links {
margin-bottom: 0;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links a {
border-radius: 20px;
background: #655997;
min-width: 30px;
height: 30px;
line-height: 30px;
color: #fff;
margin-bottom: 0;
margin-right: 1px;
text-decoration: none;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links a:hover,
.pp-multiple-authors-layout-boxed .multiple-authors-links a:focus,
.pp-multiple-authors-layout-boxed .multiple-authors-links a:active {
background: #483f6b;
color: #fff;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links a span {
min-width: 30px;
height: 30px;
line-height: 30px;
font-size: 16px;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links a:nth-child(1) {
padding: 0 14px;
margin-right: 2px;
}

.pp-multiple-authors-layout-boxed .multiple-authors-links a:nth-child(1) span {
font-size: 14px;
vertical-align: middle;
}

.pp-multiple-authors-layout-boxed p {
font-size: 0.85em;
}
Expand All @@ -64,7 +110,7 @@

.pp-multiple-authors-layout-centered .ppma-links a,
.pp-multiple-authors-layout-boxed .ppma-links a {
color: #dddddd;
color: #999;
text-decoration: none;
border-bottom: none;
-webkit-box-shadow: none;
Expand All @@ -81,7 +127,7 @@
list-style: none;
position: relative;
min-height: 120px;
border: 1px solid #dddddd;
border: 1px solid #999;
padding: 1em;
margin-bottom: 1em;
text-align: center;
Expand Down Expand Up @@ -122,3 +168,19 @@
vertical-align: middle;
display: inline-block;
}

@media (min-width:769px) {

.pp-multiple-authors-layout-boxed ul li {
display: flex;
flex-wrap: wrap;
}

.pp-multiple-authors-layout-boxed ul li > div:nth-child(1) {
flex: 0 0 110px;
}

.pp-multiple-authors-layout-boxed ul li > div:nth-child(2) {
flex: 1;
}
}
14 changes: 11 additions & 3 deletions src/core/Authors_Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Authors_Widget extends WP_Widget
public function __construct()
{
$this->title = esc_html__('Authors List', 'publishpress-authors');
Parent::__construct(
parent::__construct(
'multiple_authors_list_widget',
$this->title,
array(
Expand Down Expand Up @@ -52,11 +52,19 @@ public function widget($args, $instance)
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$output = '';


$output .= $this->get_author_box_markup($args, $instance);
if (!empty($output)) {
echo $args['before_widget'];
echo $args['before_title'] . apply_filters('widget_title', $title) . $args['after_title'];

if (!isset($instance['show_title']) || true === $instance['show_title']) {
echo sprintf(
'%s<h2 class="widget-title">%s</h2>%s',
$args['before_title'],
apply_filters('widget_title', $title),
$args['after_title']
);
}

echo $output;
echo $args['after_widget'];
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/Classes/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ public function convert_post_author($args, $assoc_args)
Utils::set_post_authors($post_id, [$author]);
WP_CLI::log("Created author and assigned to post {$post_id}.");
}

$successes++;
} // End foreach().

do_action('publishpress_authors_flush_cache');

WP_CLI\Utils\report_batch_operation_results('post author', 'convert', $total, $successes, $failures);
}

Expand Down
16 changes: 13 additions & 3 deletions src/core/Classes/Content_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ public static function filter_term_link($link, $term, $taxonomy)
*
* @param $link
* @param $author_id
* @param $author_nicename
*
* @return string
*/
public static function filter_author_link($link, $author_id, $author_nicename)
public static function filter_author_link($link, $author_id)
{
global $wp_rewrite;

Expand All @@ -98,6 +97,16 @@ public static function filter_author_link($link, $author_id, $author_nicename)

// Check if the author slug is empty in the link.
if ($link_path === str_replace('%author%', '', $permastruct)) {
error_log(
sprintf(
'[PublishPress Authors] Warning - The link for the author_id="%s" was changed to the post page because the author is not specified in the given url: %s. permastruct=%s and home_url=%s',
$author_id,
$link,
$permastruct,
home_url()
)
);

// Redirects to the post page, or home page on some situations.
$link = get_the_permalink();
}
Expand Down Expand Up @@ -179,7 +188,8 @@ public static function action_parse_request($query)
return $query;
}

$author = get_user_by('slug', sanitize_title($query->query_vars['author_name']));
$author = Utils::getUserBySlug(sanitize_title($query->query_vars['author_name']));

if (is_a($author, 'WP_User')) {
$author = Author::get_by_user_id($author->ID);
if ($author && $query->query_vars['author_name'] !== $author->slug) {
Expand Down
8 changes: 8 additions & 0 deletions src/core/Classes/Legacy/LegacyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ private function getModulesDirs()
$defaultDirs['yoast-seo-integration'] = PP_AUTHORS_MODULES_PATH;
}

if (Utils::isWPEngineInstalled()) {
$defaultDirs['wpengine-integration'] = PP_AUTHORS_MODULES_PATH;
}

if (Utils::isTheSEOFrameworkInstalled()) {
$defaultDirs['seoframework-integration'] = PP_AUTHORS_MODULES_PATH;
}

return apply_filters('ppma_module_dirs', $defaultDirs);
}

Expand Down
6 changes: 6 additions & 0 deletions src/core/Classes/Post_Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ public static function save_bulk_edit_authors()
foreach ($post_ids as $post_id) {
Utils::set_post_authors($post_id, $authors);
}

do_action('publishpress_authors_flush_cache');
}

wp_send_json_success(true, 200);
Expand Down Expand Up @@ -321,6 +323,8 @@ public static function action_save_post_authors_metabox($post_id, $post)
$authors = self::remove_dirty_authors_from_authors_arr($authors);

Utils::set_post_authors($post_id, $authors);

do_action('publishpress_authors_flush_cache');
}

/**
Expand Down Expand Up @@ -391,6 +395,8 @@ public static function action_save_post_set_initial_author($post_id, $post, $upd
$default_author = apply_filters('authors_default_author', $default_author, $post);
if ($default_author) {
Utils::set_post_authors($post_id, [$default_author]);

do_action('publishpress_authors_flush_cache');
}
}
}
Loading

0 comments on commit 92ed243

Please sign in to comment.