So, if you’re like me and supporting an older site that is still running this plugin (It shouldn’t be, upgrade to something else) but you have to keep running it for the time being while you find the perfect replacement.
I can help.
plugin folder/inc/Encoding.php starting at line 155, replace the for loop with the following code
Explanation: In php 8 we need to replace the curly braces {}
used for string offset access with square brackets []
and update the bitwise operators &
to use the &
operator for binary AND operations
for ($i = 0; $i < $max; $i++) {
$c1 = $text[$i];
if ($c1 >= "\xc0") { // Should be converted to UTF8, if it's not UTF8 already
$c2 = $i + 1 >= $max ? "\x00" : $text[$i + 1];
$c3 = $i + 2 >= $max ? "\x00" : $text[$i + 2];
$c4 = $i + 3 >= $max ? "\x00" : $text[$i + 3];
if ($c1 >= "\xc0" && $c1 <= "\xdf") { // Looks like 2 bytes UTF8
if ($c2 >= "\x80" && $c2 <= "\xbf") { // Yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2;
$i++;
} else { // Not valid UTF8. Convert it.
$cc1 = (chr(ord($c1) >> 6) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} elseif ($c1 >= "\xe0" && $c1 <= "\xef") { // Looks like 3 bytes UTF8
if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // Yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2 . $c3;
$i = $i + 2;
} else { // Not valid UTF8. Convert it.
$cc1 = (chr(ord($c1) >> 6) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} elseif ($c1 >= "\xf0" && $c1 <= "\xf7") { // Looks like 4 bytes UTF8
if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // Yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2 . $c3;
$i = $i + 2;
} else { // Not valid UTF8. Convert it.
$cc1 = (chr(ord($c1) >> 6) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} else { // Doesn't look like UTF8, but should be converted
$cc1 = (chr(ord($c1) >> 6) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} elseif (($c1 & "\xc0") == "\x80") { // Needs conversion
if (isset(self::$win1252ToUtf8[ord($c1)])) { // Found in Windows-1252 special cases
$buf .= self::$win1252ToUtf8[ord($c1)];
} else {
$cc1 = (chr(ord($c1) >> 6) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} else { // It doesn't need conversion
$buf .= $c1;
}
}
Next we need to move to the main file itself in the base folder of the plugin
easy-table.php starting at line 1209 towards the end of the file.
Explanation: We’ll keep the default value of $enclosure
as "
and have made $limit
a dynamic variable that can be adjusted based on your plugin’s options. If the $option['limit']
value is available and not empty, it will be used as the limit; otherwise, it falls back to the default value of 2000000.
Replace the entire if statement starting at 1209 with the following
if (!function_exists('easy_table_str_getcsv')) {
function easy_table_str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = '\\'){
/**
* Bug fix, custom terminator wont work
* @since version 1.1.1
*/
if( ("\r" === $delimiter) OR ("\n" === $delimiter) ) {
}
else {
$input = str_replace("\n",'NLINEBREAK',$input);
$input = str_replace("\r",'RLINEBREAK',$input);
}
$input = str_ireplace( $escape.$delimiter,'_ESCAPED_SEPATATOR_',$input );
$fiveMBs = 5 * 1024 * 1024;
$limit = 2000000; // Default value for the limit
$option = get_option('easy_table_plugin_option');
if (!empty($option['limit'])) {
$limit = (int)$option['limit'];
}
if (($handle = fopen("php://temp/maxmemory:$fiveMBs", 'r+')) !== FALSE) {
fputs($handle, $input);
rewind($handle);
$line = -1;
$return = Array();
while (($data = @fgetcsv($handle, $limit, $delimiter)) !== FALSE) {
$num = count($data);
for ($c = 0; $c < $num; $c++) {
$line++;
$data[$c] = str_replace('NLINEBREAK',"\n",$data[$c]);
$data[$c] = str_replace('RLINEBREAK',"\r",$data[$c]);
$data[$c] = str_replace('_ESCAPED_SEPATATOR_',$delimiter,$data[$c]);
$return[$line] = $data[$c];
}
}
fclose($handle);
return $return;
}
}
}
And That should do it, I hope this helps someone.
]]>I created a simple table with the following structure:
[table sort="asc"]
<h3 style="border-bottom: none;"><a href=""><img src="" alt="" width="189" height="181" />A Name</a></h3>
<h3 style="border-bottom: none;"><a href="">B Name</a></h3>
<h3 style="border-bottom: none;"><a href="">C Name</a></h3>
<h3 style="border-bottom: none;"><a href="">K Name</a></h3>
<h3 style="border-bottom: none;"><a href="">N Name</a></h3>
<h3 style="border-bottom: none;"><a href="">M Name</a></h3>
[/table]
I can see the sort doesn’t seem to reorder the N & the M names, is there something I need to set or install to get sorting to work correctly?
]]>Good day. I deactivated its CSS, but when I need to be Green a full line of table like:
10,20,30,40,50
Then only 10 is green, all other must separately clicking to green text, and not only 5… :/
This will be repaired in future?
With we believe the most recent WordPress update before 2019-02-17, the Easy Table plugin fails with the error “Error trying to read the file/URL”. We tried everything we could think of. Our troubleshooting narrowed it down to the plugin.
I noticed in the support forum an unresolved ticket for the same symptom.
Finally, we uninstalled your plugin and used another one, but we’d prefer to use yours.
]]>I wanted to have some background-colour in some cells, so I wrote a CSS definition
.my-table-cellpaint
{
background-color: #d9d9d9;
}
Now I don’t know, what caused a hover effect, but when I hovered mouse over such cell, the background became white (= the background colour of the body) again. I have no action associated with the hover, so this was just visually annoying.
The remedy was to add a row into the CSS
.my-table-cellpaint
{
background-color: #d9d9d9;
pointer-events: none;
}
]]>
I have a custom table header background colour (a dark grey) and text colour (white). Maybe it’s my font, but anyway the header texts get slightly blurred, because they are in bold. To get rid off that blur I decided to have normal font weight. So I added in the settings a custom table class, my-table-class
, which I had defined as
.my-table-class
{
font-weight: normal;
}
but this didn’t do the trick. It turned out, that there is no built-in setting for the table header, but you have to override the built-in definition by:
.easy-table th
{
font-weight: normal;
}
]]>
I’m trying some days to make EasyTable plugin sort Czech characters correctly.
Now I have sort order A-Z and after them letters with diacritics. “ABCDEFGHChIJKLMNOPQRSTUVWXYZá??éěí?ó???ú?Y?”
Can EasyTable plugin read language settings of my WordPress installation and change the sort order according to language? For Czech language it is “AáBC?D?EéěFGHChIíJKLMN?OóPQR?S?T?Uú?VWXYYZ?”.
]]>hii..
thanks for great plugin.
I need simple filters at top of columns. Just simple textboxes where by entering any text, table data will be filtered. Another thing is colspan/rowspan functionality. And i am ready to pay for this development, if you can get this programmed for me. Kindly quote..
Hi
There are some pages in my blog where Easy Table works as it should. However, three pages with CSV files are not displayed in the intended way.
I have saved my CSV files in Windows UTF-8 format and only three of them have layout problems. The link to one of these is C16.
Here’s another link that works properly: https://fusecorpus.eu/explore/the-audio-recordings-transcripts-and-metadata/c8/
I would really appreciate all kinds of advice.
]]>My table is only responsive on my wide screen desktop monitor and in a mobile form. When you shrink the window down, the far right columns get cut off until you reach a 765px breakpoint, where it becomes mobile responsive. I need this table to be seen on all devices. Why isn’t it fully responsive? How can I fix this issue? Any information is greatly appreciated.
Thank you!
]]>Hi,
I have been using Easy Table plugin really well for a long time.
But on mobile, another row is made at the bottom on desktop while the Table looks fine on the website like this link
Is there any way to get rid of this row?
I want to insert the table by using the short code below.
[table1]
??, Nha Hat Thanh Pho (Saigon Opera House)
??,7 Lam Son Square – Ben Nghe Ward – District 1 – Ho Chi Minh City
[/table1]
Thank you.
]]>Looks like this excellent plugin is back up and running again??
]]>This plugin seems to have disappeared from the list of available plugins and the author’s website holds no clue as to what’s happening (or anything else really).
Can anyone recommend a suitable replacement?
]]>Hi,
I can’t find the plugin in WordPress Plugin directory. What happened?
]]>III. DESCRIPTION
————————-
Has been detected a Persistent XSS vulnerability in Easy Table, that allows the execution of arbitrary HTML/script code to be executed in the context of the victim user’s browser.
IV. PROOF OF CONCEPT
————————-
Malicious Request:
/wordpress/wp-admin/options-general.php?page=easy-table
easy_table_plugin_option[shortcodetag]
easy_table_plugin_option[attrtag]
easy_table_plugin_option[class]
easy_table_plugin_option[width]
easy_table_plugin_option[border]
easy_table_plugin_option[align]
easy_table_plugin_option[limit]
easy_table_plugin_option[nl]
easy_table_plugin_option[terminator]
easy_table_plugin_option[delimiter]
easy_table_plugin_option[escape]
In all of this parameters an attacker can inject for example “><script>alert(1)</script> to perform a attack of Persistent Cross-Site Scripting.
]]>Hello, dash – behaves as delimiter, can you add support of this two characters to your plugin?
(between & and # no space ?? )
& #8211; replace with –
& #8212; replace with —
$char_codes = array( '& #8216;', '& #8217;', '& #8220;', '& #8221;', '& #8242;', '& #8243;','& #8211;','& #8212;' );
$replacements = array( "'", "'", '"', '"', "'", '"','-','-');
]]>
I’m inserting two tables using two shortcodes, each with a pair of classes. The first table shows both classes, but the second table only shows the first class – it’s completely missing from the html.
Also the table class in the plugin settings isn’t being added to any tables anywhere unless there are no other classes specified.
]]>In line 178 we have:
$content = str_replace(‘ ‘,”,$content);
I believe this is not a good decision because replacing non-breaking spaces with an empty string may lead to concatenation of separate words which may change the meaning of the text.
Tables often contain numerical data with unit symbols, where inserting a non-breaking space between number and unit symbol, (eg. “3 cm”) is often considered a good practice.
Furthermore, in some languages (eg. Polish), inserting non-breaking spaces after all one-letter conjunctions is considered a good typography practice because a hanging one letter conjunction in a normal-width text column is considered a typographic error. There is a plugin that inserts the non-breaking spaces automatically (https://www.ads-software.com/plugins/automatic-nbsp/), and the functionality collides with Easy Table’s nbsp; removal behavior.
What i propose is one of the following:
1. Do not remove
2. Replace with a normal space.
I would recommend solution 1. because of the reasons stated above.
]]>Is it possible to have Easy Table pull CSV data from a custom field rather than a file? Only reason I ask is I’m converting from Textpattern and have hundreds of posts with table CSV data in two custom fields.
]]>When the web window is collapsed or launched on mobile. How do I get rid of the border?
]]>In Firefox my table works fine on https://backpaxtravel.com/backpacker-jobs/ but not in Google Chrome – the width is too wide. How do I fix this?
]]>As above, is there a way or line of code to disable the table stripe so that all rows shows the same color as white?
Thank you
]]>Hi
I dont see owner replying to posts .. and his domain takien is also gone … SO want to know Is this plugin still developing ?
regard
jp
Guys,
I hoping to fix column widths so that tables stacked on a page appear in a uniform manner. AIs this possible with Easy Table and if so can you help with the syntax please?
Thanks.
]]>I’d like the cell content to remain on 1 line, even in mobile. How can I achieve this? It’s fine in desktop and tablet mode.
]]>Hi.
I’m using this plugin for the multi-language site I’m developing. In English version switching between multiple tables (tabs) works fine. But in Russian version I got this error when clicking on any tab:
jquery.js?ver=1.12.4:2 Uncaught Error: Syntax error, unrecognized expression: #tab-1-%d1%87%d0%b5%d0%bc%d0%bf%d0%b8%d0%be%d0%bd%d0%b0%d1%82-%d0%bc%d0%b8%d1%80%d0%b0
Seems like a special character problem but the charset of site is UTF-8 and there are no issues with Latvian special characters (?,?,ā).
Here’s the code:
[tab title="Олимпийские игры"]
[table width="585" colwidth="30|275|50|200|30" colalign="center|left|center|left|center" limit="11"]
Место[attr sort="asc"],Вид гонки,Год,Етап,Ссылка
9,Гонка преследования 12.5 км,2014,Сочи,<a href="https://services.biathlonresults.com/results.aspx?RaceId=BT1314SWRLOG__SMPU" target="_blank"><img src="https://www.rastorgujevs.lv/wp-content/uploads/2016/10/document.png" alt="IBU DATACENTER" width="24" height="24" /></a>
[/table]
[/tab]
]]>
I am using this handy plugin. It works perfectly loading a *.csv file when I use comma as separator, but when I try to use a *.csv file that used semicolon (;) as separator, I go to the easy table plugin settings and in de “Delimiter” option change de (,) by a (;) and click in the SAVE button, update the page wich contains the new csv file with the semicolon as separator and apparently, it doesn’t work.
Do anyone know how to fix this issue?
]]>Hi,
For some time, the contents of the tables do not display any more in the administration, on computers Mac only.
Thank you in advance for your help,
Regards,
Joan
Is it possible for the header to be the first two rows? I tried using th=”2″ but it doesn’t work.
]]>Is it possible to get vertical lines in the style of the table so that there are vertical AND horizontal lines throughout the entire table?
]]>