Wordpress : Genesis-Legacy Theme error - wordpress

I am getting this error message on some of my pages within worrdpress dashboard.
Google Analytics Stats
Warning: array_merge(): Argument #1 is not an array in
/home/c5280den/public_html/wp-content/plugins/google-analyticator/google-api-php-client/src/Google_Client.php
on line 40
Fatal error: Class name must be a valid object or a string in
/home/c5280den/public_html/wp-content/plugins/google-analyticator/google-api-php-client/src/Google_Client.php
on line 104
Any help is most appreciated!!

Update your plugin bro.. If updated already, try this.
FILE - google-analyticator > google-api-php-client > src > Google_Client.php
OLD CODE (starting at Line 35)
require_once "config.php";
// If a local configuration file is found, merge it's values with the default configuration
if (file_exists(dirname(__FILE__) . '/local_config.php')) {
$defaultConfig = $apiConfig;
require_once (dirname(__FILE__) . '/local_config.php');
$apiConfig = array_merge($defaultConfig, $apiConfig);
NEW CODE (starting at Line 35)
require_once (dirname(__FILE__) . "/config.php");
// If a local configuration file is found, merge it's values with the default configuration
if (file_exists(dirname(__FILE__) . '/local_config.php')) {
$defaultConfig = $apiConfig;
require_once (dirname(__FILE__) . '/local_config.php');
$apiConfig = array_merge($defaultConfig, $apiConfig);
Adding to line 35...
require_once (dirname(__FILE__) . "/config.php");
in place of...
require_once "config.php";
seems to have fixed the problem.
Get it from here https://wordpress.org/support/topic/recent-update-throws-error-in-settings-page

Related

Why do I encounter Fatal error in publishing a Responsive Pricing Table?

Once I hit publish in Add New pricing table I encounter this error:
Fatal error: Call to undefined function sanitize_hex_color() in /var/domains/main/wp-content/plugins/dk-pricr-responsive-pricing-table/inc/rpt-save-metaboxes.php on line 69
in WordPress version 4.6, this function has been moved to the file wp-includes/formatting.php, first include this file, and then call the function :
if ( ! function_exists( 'sanitize_hex_color' ) ) {
include ABSPATH . 'wp-includes/formatting.php';
}

PhpUnit : Error: Unable to access jarfile ./../src/Java/File.jar

When I run the test of my page, I encounter this error message that I do not have on the browser:
Error: Unable to access jarfile ./../src/Java/File.jar
Here is the call to the file in my controller (symfony 4):
exec("java -jar ./../src/Java/File.jar $params",$tab);
Here is my test method :
public function testView(){
$crawler = $this->client->request('GET','/test/1');
if( Response::HTTP_OK !== $this->client->getResponse()->getStatusCode()){
echo $crawler->filter('div.exception-message-wrapper')->text();
echo $crawler->filter('.trace-html-1')->text();
}
static::assertEquals(
Response::HTTP_OK,
$this->client->getResponse()->getStatusCode()
);
}
thanks for your help
In your controller you could try using a path to the jar which will be relative to the __DIR__.
exec("java -jar " . __DIR__ . "../src/Java/File.jar $params", $tab);
To understand, you can read more about __DIR__ here

ZipArchive::close(): Renaming temporary file failed: Invalid argument Phpexcel Laravel

I am working on append excel content into existing excel file and save it in a predefined directory with different name. I am using the Laravel 5.4 framework for my application.
I am using the below code to create excel file and save it on specified location:
$objPHPExcel = \PHPExcel_IOFactory::createReader('Excel2007');
//Load Existing excel file into I want to append
$objPHPExcel = $objPHPExcel->load(getDocumentPath().'/Report_Template_UG.xlsx');
$objPHPExcel->setActiveSheetIndex(0);
//Here I have Written code to insert my data into loaded excel file
$today = date('d-m-Y');
$time = date('H:i:s');
$filename = 'Report_'.$today.' '.$time.'.xlsx';
//welcomed is the root directory name of laravel project
$dir = 'C:\xampp\htdocs\welcomed\storage\documents\';
$filepath = $dir . $filename;
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($path);
On executing the above code, I am gettign the below error:
ErrorException in Excel2007.php line 377:
ZipArchive::close(): Renaming temporary file failed: Invalid argument
Can anyone please tell me, What I have done wrong in above code or do I have missed something?
Thanks

Wordpress get current time error on functions.php

I want to get the current time of wordpress, but I got errors, how to fix it? is there another way to get the current time of the wordpress?, I want the time that wordpress using with format (+GMT) and what the user choose, not the server time.
This is my code
<?php
require_once( '/wp-includes/functions.php' );
$format = get_option('date_format') . ' ' . get_option('time_format');
print date_i18n($format, current_time('timestamp'));
?>
These are the errors
Notice: Use of undefined constant ABSPATH - assumed 'ABSPATH' in C:\xampp1\htdocs\wp\wp-includes\functions.php on line 8
Notice: Use of undefined constant WPINC - assumed 'WPINC' in C:\xampp1\htdocs\wp\wp-includes\functions.php on line 8
Warning: require(ABSPATHWPINC/option.php): failed to open stream: No such file or directory in C:\xampp1\htdocs\wp\wp-includes\functions.php on line 8
Fatal error: require(): Failed opening required 'ABSPATHWPINC/option.php' (include_path='.;C:\xampp1\php\PEAR') in C:\xampp1\htdocs\wp\wp-includes\functions.php on line 8
You don't need to include require_once( '/wp-includes/functions.php' );. Directly use the function it will return GMT time like below
<?php echo current_time( 'mysql', 1 ); ?>
For more Please refer this link http://codex.wordpress.org/Function_Reference/current_time

Compilation failed while installing plugin in wordpress

I could customize wordpress theme http://www.apptha.com/demo/video-stream in localhost well .
But I am tring to upload in server get the following error.
Warning: preg_replace_callback(): Compilation failed: missing opening brace after \o at offset 18 in /home/const/public_html/apptha/wp-content/plugins/contus-video-gallery/hdflvvideoshare.php on line 545
My site is http://constantin-entertainment.info/apptha/
here Wordpress video gallery plugin is used, the error pointed line is
$pageContent = preg_replace_callback( '/\[hdvideo ([^]]*)\o]/i', 'video_shortcodeplace', $pageContent );
Please help me..!
Looks like you need to escape the backslash,
$pageContent = preg_replace_callback( '/\[hdvideo ([^]]*)\\o]/i', 'video_shortcodeplace', $pageContent );
Open \wp-content\plugins\contus-video-gallery\hdflvvideoshare.php file and find add_filter('the_content', 'videogallery_pagereplace'); and replace with the following code.
add_shortcode('videohome','video_homereplace');
add_shortcode('videomore','video_morereplace');
add_shortcode('hdvideo','video_shortcodereplace');
Replace
$pageContent = preg_replace_callback('/\[hdvideo ([^]]*)\o]/i',
'video_shortcodeplace',
$pageContent
);
with
$pageContent = preg_replace_callback('/\[hdvideo\s*.*?=(\d+)\]/i',
'video_shortcodeplace',
$pageContent
);

Resources