Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added product review link in about us page #259

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/js/src/about/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ export default function Header( { pages = [], selected = '' } ) {
return hash === selected ? 'active' : '';
};

const supportURLBasePath = ['neve', 'hestia'].indexOf( currentProduct.slug ) > -1 ? 'theme' : 'plugin';
const reviewLink = `https://wordpress.org/support/${supportURLBasePath}/${currentProduct.slug?.replaceAll( '_', '-' )}/reviews/#new-post`;

return (
<div>
<div className="head">
<div className="container">
<img src={logoUrl} alt={currentProduct.name}/>
<p>by <a href="https://themeisle.com">Themeisle</a></p>
<p className="review-link">Enjoying {currentProduct.name}? <a href={reviewLink} target="_blank">Give us a rating!</a></p>
</div>
</div>
{( links.length > 0 || pages.length > 0 ) && <div className="container">
Expand Down
3 changes: 3 additions & 0 deletions assets/js/src/about/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

p {
margin-left: 10px;
&.review-link {
margin-left: auto;
}
}

a {
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Abstract_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function get_sdk_uri() {
* hence we also need to check that the path does not point to the theme else this will break the URL.
* References: https://github.com/Codeinwp/neve-pro-addon/issues/2403
*/
if ( $this->product->is_plugin() && false === strpos( $themeisle_sdk_max_path, get_template_directory() ) ) {
if ( ( $this->product->is_plugin() || $this->product->is_theme() ) && false === strpos( $themeisle_sdk_max_path, get_template_directory() ) ) {
return plugins_url( '/', $themeisle_sdk_max_path . '/themeisle-sdk/' );
};

Expand Down
15 changes: 10 additions & 5 deletions src/Modules/About_us.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private function get_other_products_data() {
'name' => 'Otter',
],
'tweet-old-post' => [
'name' => 'Revive Old Post',
'name' => 'Revive Social',
],
'feedzy-rss-feeds' => [
'name' => 'Feedzy',
Expand Down Expand Up @@ -372,6 +372,12 @@ private function get_other_products_data() {
'name' => 'Templates Cloud',
'description' => Loader::$labels['about_us']['others']['tpc_desc'],
],
'wp-cloudflare-page-cache' => [
'name' => 'Super Page Cache',
],
'hyve-lite' => [
'name' => 'Hyve Lite',
],
];

foreach ( $products as $slug => $product ) {
Expand Down Expand Up @@ -409,14 +415,13 @@ private function get_other_products_data() {
}

$api_data = $this->call_plugin_api( $slug );

if ( ! isset( $product['icon'] ) ) {
if ( ! isset( $product['icon'] ) && ( isset( $api_data->icons['2x'] ) || $api_data->icons['1x'] ) ) {
$products[ $slug ]['icon'] = isset( $api_data->icons['2x'] ) ? $api_data->icons['2x'] : $api_data->icons['1x'];
}
if ( ! isset( $product['description'] ) ) {
if ( ! isset( $product['description'] ) && isset( $api_data->short_description ) ) {
$products[ $slug ]['description'] = $api_data->short_description;
}
if ( ! isset( $product['name'] ) ) {
if ( ! isset( $product['name'] ) && isset( $api_data->name ) ) {
$products[ $slug ]['name'] = $api_data->name;
}
}
Expand Down
Loading